diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f3fe94d..c29c2489 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,11 @@ Will now log the update commands and their output similar to the Plugin Manager install and uninstall dialog. +### Bug Fixes + +* It's not possible anymore to select files that are not machinecode files (e.g. + GCODE) for printing on the file API. + ## 1.2.2 (2015-06-30) ### Bug Fixes diff --git a/src/octoprint/server/api/files.py b/src/octoprint/server/api/files.py index 9c318a6b..5edb1dab 100644 --- a/src/octoprint/server/api/files.py +++ b/src/octoprint/server/api/files.py @@ -292,6 +292,9 @@ def gcodeFileCommand(filename, target): if command == "select": # selects/loads a file + if not octoprint.filemanager.valid_file_type(filename, type="machinecode"): + return make_response("Cannot select {filename} for printing, not a machinecode file".format(**locals()), 415) + printAfterLoading = False if "print" in data.keys() and data["print"] in valid_boolean_trues: if not printer.is_operational():