middleware/jwt: escape infohash when debugging
Without this, the log lines end up looking like: request=��1�H�7L a���-��7
This commit is contained in:
parent
6c3ddaefb3
commit
035c5b4960
1 changed files with 1 additions and 1 deletions
|
@ -175,7 +175,7 @@ func validateJWT(ih bittorrent.InfoHash, jwtBytes []byte, cfgIss, cfgAud string,
|
||||||
if ihClaim, ok := claims.Get("infohash").(string); !ok || !validInfoHash(ihClaim, ih) {
|
if ihClaim, ok := claims.Get("infohash").(string); !ok || !validInfoHash(ihClaim, ih) {
|
||||||
log.WithFields(log.Fields{
|
log.WithFields(log.Fields{
|
||||||
"exists": ok,
|
"exists": ok,
|
||||||
"request": ih,
|
"request": url.QueryEscape(ih.String()),
|
||||||
"claim": ihClaim,
|
"claim": ihClaim,
|
||||||
}).Debugln("unequal or missing infohash when validating JWT")
|
}).Debugln("unequal or missing infohash when validating JWT")
|
||||||
return errors.New("claim \"infohash\" is invalid")
|
return errors.New("claim \"infohash\" is invalid")
|
||||||
|
|
Loading…
Add table
Reference in a new issue