Skip to content

Commit

Permalink
fix (upload): shared link in upload
Browse files Browse the repository at this point in the history
  • Loading branch information
mickael-kerjean committed Oct 23, 2024
1 parent 96b566e commit f7988ff
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions public/assets/pages/filespage/ctrl_upload.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createElement, createFragment, createRender } from "../../lib/skeleton/index.js";
import rxjs, { effect, onClick } from "../../lib/rx.js";
import { forwardURLParams } from "../../lib/path.js";
import { animate, slideYOut } from "../../lib/animate.js";
import { loadCSS } from "../../helpers/loader.js";
import { qs } from "../../lib/dom.js";
Expand Down Expand Up @@ -307,7 +308,13 @@ function workerImplFile({ error, progress, speed }) {
const xhr = new XMLHttpRequest();
this.xhr = xhr;
return new Promise((resolve, reject) => {
xhr.open("POST", "api/files/cat?path=" + encodeURIComponent(path));
xhr.open(
"POST",
forwardURLParams(
"api/files/cat?path=" + encodeURIComponent(path),
["share"],
),
);
xhr.withCredentials = true;
xhr.setRequestHeader("X-Requested-With", "XmlHttpRequest");
xhr.upload.onprogress = (e) => {
Expand Down Expand Up @@ -380,7 +387,13 @@ function workerImplDirectory({ error, progress }) {
const xhr = new XMLHttpRequest();
this.xhr = xhr;
return new Promise((resolve, reject) => {
xhr.open("POST", "api/files/mkdir?path=" + encodeURIComponent(path));
xhr.open(
"POST",
forwardURLParams(
"api/files/mkdir?path=" + encodeURIComponent(path),
["share"],
),
);
xhr.withCredentials = true;
xhr.setRequestHeader("X-Requested-With", "XmlHttpRequest");
xhr.onerror = function(e) {
Expand Down

0 comments on commit f7988ff

Please sign in to comment.