server/rest: unescape percent-encoded route parameters

for routes that address things by name instead of ID, e.g. /tag/tagname,
where we allow special characters, we need to unescape the values.
This commit is contained in:
Eva
2025-03-26 20:12:04 +01:00
parent 782f069031
commit 888f83337b

View File

@ -101,7 +101,7 @@ def application(
for hook in middleware.pre_hooks:
hook(ctx)
try:
response = handler(ctx, match.groupdict())
response = handler(ctx, {k: urllib.parse.unquote(v) for k, v in match.groupdict().items()})
except Exception:
ctx.session.rollback()
raise