Skip to content

Commit

Permalink
馃悰 Better validation of tool parameter on /api/printer/tool
Browse files Browse the repository at this point in the history
Fixes #3092
  • Loading branch information
foosel committed Mar 28, 2019
1 parent 1a2739c commit df6e94f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/octoprint/server/api/printer.py
Expand Up @@ -86,7 +86,7 @@ def printerToolCommand():
##~~ tool selection
if command == "select":
tool = data["tool"]
if re.match(validation_regex, tool) is None:
if not isinstance(tool, basestring) or re.match(validation_regex, tool) is None:
return make_response("Invalid tool: %s" % tool, 400)
if not tool.startswith("tool"):
return make_response("Invalid tool for selection: %s" % tool, 400)
Expand Down

0 comments on commit df6e94f

Please sign in to comment.