fix(cors): make origin optional in CORSOptions (#4905)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
* fix(cors): make origin optional in CORSOptions The CORS middleware applies a default of `origin: '*'` when no value is provided, and the JSDoc already documents `[options.origin='*']` (square brackets indicating optional). The type required `origin`, so calling `cors({ allowMethods: ['GET', 'POST'] })` errored at compile time even though the runtime worked correctly. Make `origin` optional on `CORSOptions` so the type matches the runtime default. No runtime change. Test verifies omitting `origin` produces `Access-Control-Allow-Origin: *` and an explicit `allowMethods` value still applies. Closes #4904 * remove the type error ---------
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
Diff stats
2 files+21 added−6 removed
- tests:+18 added−0 removed
- other:+3 added−6 removed