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:
Jimmy Zelinskie 2017-06-06 13:06:44 -04:00
parent 6c3ddaefb3
commit 035c5b4960

View file

@ -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) {
log.WithFields(log.Fields{
"exists": ok,
"request": ih,
"request": url.QueryEscape(ih.String()),
"claim": ihClaim,
}).Debugln("unequal or missing infohash when validating JWT")
return errors.New("claim \"infohash\" is invalid")