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
No known key found for this signature in database
GPG Key ID: 7027245FBBDDF59A
1 changed files with 1 additions and 1 deletions

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: