Fix WebDAV discovery

Also fix stricter SSO providers which require the paths to match in `redirect_uri`.

Probably fixes #66
This commit is contained in:
Bruno Bernardino
2025-06-06 11:30:04 +01:00
parent 717f55f0af
commit 3038461fb7
2 changed files with 6 additions and 4 deletions

View File

@@ -5,7 +5,9 @@ import { getDataFromRequest } from '/lib/auth.ts';
export const handler = [
async function handleCors(request: Request, context: FreshContext<FreshContextState>) {
if (request.method == 'OPTIONS') {
const path = new URL(request.url).pathname;
if (request.method == 'OPTIONS' && path !== '/dav' && !path.startsWith('/dav/')) {
const response = new Response(null, {
status: 204,
});