🐛 Fix double encoding of file resources

`url_for` seems to be doing the encoding already after all,
so we must not do it as well.

Fixes #4293
This commit is contained in:
Gina Häußge committed 2021-11-02 17:19:32 +01:00
1 parent 7d5474cb3d
commit 444fe44d48
1 file changed
+8 -8
+8 -8
View File
@@ -330,7 +330,7 @@ def _getFileList(
"resource": url_for(
".readGcodeFile",
target=FileDestinations.SDCARD,
filename=urlquote(f["name"]),
filename=f["name"],
_external=True,
)
},
@@ -392,7 +392,7 @@ def _getFileList(
"resource": url_for(
".readGcodeFile",
target=FileDestinations.LOCAL,
filename=urlquote(path + file_or_folder["name"]),
filename=path + file_or_folder["name"],
_external=True,
)
}
@@ -446,7 +446,7 @@ def _getFileList(
"resource": url_for(
".readGcodeFile",
target=FileDestinations.LOCAL,
filename=urlquote(file_or_folder["path"]),
filename=file_or_folder["path"],
_external=True,
),
"download": url_for("index", _external=True)
@@ -692,7 +692,7 @@ def uploadGcodeFile(target):
location = url_for(
".readGcodeFile",
target=FileDestinations.LOCAL,
filename=urlquote(filename),
filename=filename,
_external=True,
)
files.update(
@@ -717,7 +717,7 @@ def uploadGcodeFile(target):
location = url_for(
".readGcodeFile",
target=FileDestinations.SDCARD,
filename=urlquote(sdFilename),
filename=sdFilename,
_external=True,
)
files.update(
@@ -769,7 +769,7 @@ def uploadGcodeFile(target):
location = url_for(
".readGcodeFile",
target=FileDestinations.LOCAL,
filename=urlquote(added_folder),
filename=added_folder,
_external=True,
)
folder = {
@@ -1041,7 +1041,7 @@ def gcodeFileCommand(filename, target):
location = url_for(
".readGcodeFile",
target=target,
filename=urlquote(full_path),
filename=full_path,
_external=True,
)
result = {
@@ -1164,7 +1164,7 @@ def gcodeFileCommand(filename, target):
location = url_for(
".readGcodeFile",
target=target,
filename=urlquote(destination),
filename=destination,
_external=True,
)
result = {