Commit b30f6e68 authored by Lukáš Lalinský's avatar Lukáš Lalinský

Log invalid fingerprints

parent a38f942f
Pipeline #20568 passed with stages
in 3 minutes and 57 seconds
......@@ -196,6 +196,7 @@ class LookupHandlerParams(APIHandlerParams):
raise errors.MissingParameterError('fingerprint' + suffix)
fingerprint = decode_fingerprint(fingerprint_string.encode('ascii', 'ignore'))
if not fingerprint:
logger.info('Got invalid fingerprint %r', fingerprint_string)
raise errors.InvalidFingerprintError()
return FingerprintLookupQuery(index=index, duration=duration, fingerprint=fingerprint)
......@@ -697,6 +698,7 @@ class SubmitHandlerParams(APIHandlerParams):
raise errors.MissingParameterError('fingerprint' + suffix)
p['fingerprint'] = decode_fingerprint(fingerprint_string.encode('ascii', 'ignore'))
if not p['fingerprint']:
logger.info('Got invalid fingerprint %r', fingerprint_string)
raise errors.InvalidFingerprintError()
p['bitrate'] = values.get('bitrate' + suffix, type=int) or None
if p['bitrate'] is not None and p['bitrate'] <= 0:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment