feat: support folder uploads and sanitize upload paths
- Implement `cleanUploadDisplayName` in the backend to safely sanitize uploaded file paths, preserving directory structures while stripping unsafe characters and preventing path traversal. - Add folder upload capability in the frontend using the Directory Picker API. - Implement desktop notifications for completed uploads.
This commit is contained in:
@@ -5,6 +5,26 @@ self.addEventListener("fetch", (event) => {
|
||||
}
|
||||
});
|
||||
|
||||
self.addEventListener("notificationclick", (event) => {
|
||||
event.notification.close();
|
||||
const url = event.notification.data && event.notification.data.url ? event.notification.data.url : "/";
|
||||
event.waitUntil((async () => {
|
||||
const windows = await clients.matchAll({ type: "window", includeUncontrolled: true });
|
||||
for (const client of windows) {
|
||||
if ("focus" in client) {
|
||||
await client.focus();
|
||||
if ("navigate" in client) {
|
||||
await client.navigate(url);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (clients.openWindow) {
|
||||
await clients.openWindow(url);
|
||||
}
|
||||
})());
|
||||
});
|
||||
|
||||
const SHARE_CACHE = "warpbox-share-target-v1";
|
||||
const SHARE_PREFIX = "/__warpbox_share_target__/";
|
||||
const LATEST_KEY = SHARE_PREFIX + "latest";
|
||||
|
||||
Reference in New Issue
Block a user