Improve WebDav support to include file size and modified time

This commit is contained in:
Bruno Bernardino
2024-04-08 16:01:59 +01:00
parent c1443191ce
commit 5229e196b4
5 changed files with 69 additions and 30 deletions

View File

@@ -39,7 +39,11 @@ export const handler: Handlers<Data, FreshContextState> = {
return new Response(fileResult.contents!, {
status: 200,
headers: { 'cache-control': 'no-cache, no-store, must-revalidate', 'content-type': fileResult.contentType! },
headers: {
'cache-control': 'no-cache, no-store, must-revalidate',
'content-type': fileResult.contentType!,
'content-length': fileResult.byteSize!.toString(),
},
});
},
};