Skip to content
Snippets Groups Projects
Commit d2e3d5b9 authored by Erik Johnston's avatar Erik Johnston
Browse files

Handle incorrectly encoded query params correctly

parent 58af30a6
No related branches found
No related tags found
No related merge requests found
......@@ -166,7 +166,12 @@ def parse_string_from_args(
value = args[name][0]
if encoding:
value = value.decode(encoding)
try:
value = value.decode(encoding)
except ValueError:
raise SynapseError(
400, "Query parameter %r must be %s" % (name, encoding)
)
if allowed_values is not None and value not in allowed_values:
message = "Query parameter %r must be one of [%s]" % (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment