-
Notifications
You must be signed in to change notification settings - Fork 293
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Environment
h3 1.15.3 but the bug is still in the main branch
Reproduction
I don't think the repro is needed as the bug is obvious by looking at the code. Let me know if you absolutely require it.
Describe the bug
h3 cors module has some default options:
Lines 22 to 32 in 459093d
const defaultOptions: ResolvedCorsOptions = { | |
origin: "*", | |
methods: "*", | |
allowHeaders: "*", | |
exposeHeaders: "*", | |
credentials: false, | |
maxAge: false, | |
preflight: { | |
statusCode: 204, | |
}, | |
}; |
However they are not actually used when generating CORS headers (only what the user explicitly passes is used):
Lines 151 to 153 in 459093d
const _options = resolveCorsOptions(options); | |
if (isPreflightRequest(event)) { | |
appendCorsPreflightHeaders(event, options); |
As the result, preflight response doesn't include access-control-allow-methods: *
despite it being the default value.
Additional context
No response
Logs
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working