Working webdav backend!

This commit is contained in:
Geert Rademakes 2025-09-17 13:22:19 +02:00
parent 7065247277
commit d747830384
2 changed files with 6 additions and 4 deletions

View File

@ -96,7 +96,7 @@ export class WebDAVService implements StorageProvider {
return {
key: finalKey,
url: `${this.basePath}/${finalKey}`,
url: `${this.config.url}${this.basePath}/${finalKey}`,
size: file.length,
contentType,
};
@ -172,8 +172,8 @@ export class WebDAVService implements StorageProvider {
*/
async getPresignedUrl(key: string, expiresIn: number = 3600): Promise<string> {
// WebDAV doesn't support presigned URLs, so we return a direct URL
// In a real implementation, you might want to implement token-based access
const baseUrl = (this.client as any).getURL?.() || (this.client as any).toString() || this.config.url;
// Use the config URL directly since WebDAV client doesn't expose getURL()
const baseUrl = this.config.url;
return `${baseUrl}${this.basePath}/${key}`;
}
@ -222,7 +222,8 @@ export class WebDAVService implements StorageProvider {
* Get streaming URL for a file
*/
async getStreamingUrl(key: string): Promise<string> {
const baseUrl = (this.client as any).getURL?.() || (this.client as any).toString() || this.config.url;
// Use the config URL directly since WebDAV client doesn't expose getURL()
const baseUrl = this.config.url;
return `${baseUrl}${this.basePath}/${key}`;
}

View File

@ -0,0 +1 @@
test content