octoprint_compat: validate web_request args

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2023-02-18 20:25:47 -05:00
parent 6a5a5b50d3
commit fd5ea0c6a4
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B
1 changed files with 3 additions and 3 deletions

View File

@ -355,12 +355,12 @@ class OctoPrintCompat:
async def _select_file(self,
web_request: WebRequest
) -> None:
command: str = web_request.get('command')
rel_path: str = web_request.get('relative_path')
command: str = web_request.get_str('command')
rel_path: str = web_request.get_str('relative_path')
root, filename = rel_path.strip("/").split("/", 1)
fmgr: FileManager = self.server.lookup_component('file_manager')
if command == "select":
start_print: bool = web_request.get('print', False)
start_print: bool = web_request.get_boolean('print', False)
if not start_print:
# No-op, selecting a file has no meaning in Moonraker
return