aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/Buttons.hx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/Buttons.hx')
-rw-r--r--src/client/Buttons.hx7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/client/Buttons.hx b/src/client/Buttons.hx
index 513133a..11b8f7c 100644
--- a/src/client/Buttons.hx
+++ b/src/client/Buttons.hx
@@ -248,7 +248,10 @@ class Buttons {
getEl("#mediaurl-upload").onclick = e -> {
Utils.browseFile((buffer, name) -> {
- if (name == null || name.length == 0) name = "video";
+ name ??= "";
+ name = ~/[?#%\/\\]/g.replace(name, "").trim();
+ if (name.length == 0) name = "video";
+ name = (window : Dynamic).encodeURIComponent(name);
// send last chunk separately to allow server file streaming while uploading
final chunkSize = 1024 * 1024 * 5; // 5 MB
@@ -258,7 +261,6 @@ class Buttons {
method: "POST",
headers: {
"content-name": name,
- "client-name": main.getName(),
},
body: lastChunk,
});
@@ -276,7 +278,6 @@ class Buttons {
final request = new XMLHttpRequest();
request.open("POST", "/upload", true);
request.setRequestHeader("content-name", name);
- request.setRequestHeader("client-name", main.getName());
request.upload.onprogress = (event:ProgressEvent) -> {
var ratio = 0.0;
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage