Use encodeURI for paths
Moonraker expects file paths to use un-escaped file paths, such as gcodes/some%20file.gcode, but encodeURIComponent will always escape the slash. Using encodeURI here will not.
This commit is contained in:
parent
458444f03a
commit
f53cd00cc1
@ -403,7 +403,7 @@
|
|||||||
let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
|
let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
|
||||||
let link = document.createElement("a");
|
let link = document.createElement("a");
|
||||||
link.download = name;
|
link.download = name;
|
||||||
link.href = 'http://' + this.hostname + ':' + this.port + '/server/files/' + encodeURIComponent(filename);
|
link.href = 'http://' + this.hostname + ':' + this.port + '/server/files/' + encodeURI(filename);
|
||||||
document.body.appendChild(link);
|
document.body.appendChild(link);
|
||||||
link.click();
|
link.click();
|
||||||
document.body.removeChild(link);
|
document.body.removeChild(link);
|
||||||
@ -435,7 +435,7 @@
|
|||||||
removeFile() {
|
removeFile() {
|
||||||
let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
|
let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
|
||||||
axios.delete(
|
axios.delete(
|
||||||
'http://'+ this.hostname + ':' + this.port +'/server/files/'+encodeURIComponent(filename)
|
'http://'+ this.hostname + ':' + this.port +'/server/files/' + encodeURI(filename)
|
||||||
).then((result) => {
|
).then((result) => {
|
||||||
this.$toast.success(result.data.result+" successfully deleted.");
|
this.$toast.success(result.data.result+" successfully deleted.");
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user