From 319f64489df808309a7f50cdffce3ab894eb39b3 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Sat, 4 Nov 2023 00:29:26 +0100 Subject: [PATCH] Fix keyword-parameter handling bug in formparams. --- wrw/util.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wrw/util.py b/wrw/util.py index dcf745a..6fa4155 100644 --- a/wrw/util.py +++ b/wrw/util.py @@ -25,6 +25,8 @@ def formparams(callable): if par.name in data: args[par.name] = data[par.name] for par in sig.parameters.values(): + if par.kind is inspect.Parameter.VAR_KEYWORD: + continue if par.default is inspect.Parameter.empty and par.name not in args: raise resp.httperror(400, "Missing parameter", ("The query parameter `", resp.h.code(par.name), "' is required but not supplied.")) return callable(**args) -- 2.11.0