Use lowercase when matching extensions

This commit is contained in:
Gina Häußge committed 2015-06-30 19:04:14 +02:00
1 parent 18816b6ea8
commit 29cee16d3e
2 files changed
+2 -2

No files matched your search

@@ -121,7 +121,7 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin,
upload_path = flask.request.values[input_upload_path]
upload_name = flask.request.values[input_upload_name]
exts = filter(lambda x: upload_name.endswith(x), (".zip", ".tar.gz", ".tgz", ".tar"))
exts = filter(lambda x: upload_name.lower().endswith(x), (".zip", ".tar.gz", ".tgz", ".tar"))
if not len(exts):
return flask.make_response("File doesn't have a valid extension for a plugin archive", 400)
+1 -1
View File
@@ -97,7 +97,7 @@ def uploadLanguagePack():
upload_name = request.values[input_upload_name]
upload_path = request.values[input_upload_path]
exts = filter(lambda x: upload_name.endswith(x), (".zip", ".tar.gz", ".tgz", ".tar"))
exts = filter(lambda x: upload_name.lower().endswith(x), (".zip", ".tar.gz", ".tgz", ".tar"))
if not len(exts):
return make_response("File doesn't have a valid extension for a plugin archive", 400)