From 2e4814978f74b3258ece616647fea23c86330acd Mon Sep 17 00:00:00 2001
From: Eric Callahan <arksine.code@gmail.com>
Date: Tue, 5 Apr 2022 08:45:17 -0400
Subject: [PATCH] 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>
---
 moonraker/app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/moonraker/app.py b/moonraker/app.py
index f90db17..ef0d375 100644
--- a/moonraker/app.py
+++ b/moonraker/app.py
@@ -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: