🐛 URL escape timelapse file names as well

It turns out those are also affected by #4267
This commit is contained in:
Gina Häußge committed 2021-10-29 17:28:35 +02:00
1 parent 16086741b8
commit dfe7dc7a78
2 files changed
+10 -5

No files matched your search

+7 -2
View File
@@ -24,6 +24,11 @@ from octoprint.server.util.flask import (
)
from octoprint.settings import settings, valid_boolean_trues
try:
from urllib.parse import quote as urlquote
except ImportError:
from urllib import quote as urlquote # noqa: F401
_DATA_FORMAT_VERSION = "v2"
# ~~ timelapse handling
@@ -140,7 +145,7 @@ def getTimelapseData():
finished_list = []
for f in files:
output = dict(f)
output["url"] = url_for("index") + "downloads/timelapse/" + f["name"]
output["url"] = url_for("index") + "downloads/timelapse/" + urlquote(f["name"])
finished_list.append(output)
result = {
@@ -160,7 +165,7 @@ def getTimelapseData():
@Permissions.TIMELAPSE_DOWNLOAD.require(403)
def downloadTimelapse(filename):
return redirect_to_tornado(
request, url_for("index") + "downloads/timelapse/" + filename
request, url_for("index") + "downloads/timelapse/" + urlquote(filename)
)
@@ -11,15 +11,15 @@
var bulkDownloadUrl = "downloads/timelapses";
var timelapseUrl = function (filename) {
return url + "/" + filename;
return url + "/" + OctoPrintClient.escapePath(filename);
};
var timelapseDownloadUrl = function (filename) {
return downloadUrl + "/" + filename;
return downloadUrl + "/" + OctoPrintClient.escapePath(filename);
};
var unrenderedTimelapseUrl = function (name) {
return url + "/unrendered/" + name;
return url + "/unrendered/" + OctoPrintClient.escapePath(name);
};
var OctoPrintTimelapseClient = function (base) {