octoprint_compat: validate web_request args
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
6a5a5b50d3
commit
fd5ea0c6a4
|
@ -355,12 +355,12 @@ class OctoPrintCompat:
|
||||||
async def _select_file(self,
|
async def _select_file(self,
|
||||||
web_request: WebRequest
|
web_request: WebRequest
|
||||||
) -> None:
|
) -> None:
|
||||||
command: str = web_request.get('command')
|
command: str = web_request.get_str('command')
|
||||||
rel_path: str = web_request.get('relative_path')
|
rel_path: str = web_request.get_str('relative_path')
|
||||||
root, filename = rel_path.strip("/").split("/", 1)
|
root, filename = rel_path.strip("/").split("/", 1)
|
||||||
fmgr: FileManager = self.server.lookup_component('file_manager')
|
fmgr: FileManager = self.server.lookup_component('file_manager')
|
||||||
if command == "select":
|
if command == "select":
|
||||||
start_print: bool = web_request.get('print', False)
|
start_print: bool = web_request.get_boolean('print', False)
|
||||||
if not start_print:
|
if not start_print:
|
||||||
# No-op, selecting a file has no meaning in Moonraker
|
# No-op, selecting a file has no meaning in Moonraker
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue