app: shallow copy arguments before passing to a request

This prevents a scenario where a request handler mutates
the arguments of a WebRequest, which could result in
changing the default "request_arguments" in
"InternalTransport.call_method()".

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan
2022-04-05 08:45:17 -04:00
parent fb2eacf702
commit 2e4814978f

View File

@@ -162,7 +162,7 @@ class InternalTransport(APITransport):
# Request arguments can be suppplied either through a dict object
# or via keyword arugments
args = request_arguments or kwargs
return await func(WebRequest(ep, args, action))
return await func(WebRequest(ep, dict(args), action))
class MoonrakerApp:
def __init__(self, config: ConfigHelper) -> None: