fix: no basic auth for default file
Massimo Melina committed
Oct 22, 2023 at 20:33 UTC
8fd17af2a6b2aae9a29c2e096aeca615560d488c
1 file changed
+1
-1
src/vfs.ts
+1
-1
@@ -188,7 +188,7 @@ export function statusCodeForMissingPerm(node: VfsNode, perm: keyof VfsPerms, ct
188
const ret = getCode()
189
if (ret && assign) {
190
ctx.status = ret
191
- if (ret === HTTP_UNAUTHORIZED) // this is necessary to support standard urls with credentials
191
+ if (ret === HTTP_UNAUTHORIZED && !(node.default && node.source?.endsWith(node.default))) // this is necessary to support standard urls with credentials
192
ctx.set('WWW-Authenticate', 'Basic') // we support basic authentication
193
}
194
return ret