Skip to content

docs: fix incorrect @default for server.cors#22859

Merged
sapphi-red merged 1 commit into
vitejs:mainfrom
dfedoryshchev:docs/server-cors-default
Jul 6, 2026
Merged

docs: fix incorrect @default for server.cors#22859
sapphi-red merged 1 commit into
vitejs:mainfrom
dfedoryshchev:docs/server-cors-default

Conversation

@dfedoryshchev

Copy link
Copy Markdown
Contributor

The cors option's JSDoc says @default false, but the resolved default is a restrictive object. _serverConfigDefaults sets cors: { origin: defaultAllowedOrigins } and it is applied via mergeWithDefaults in resolveServerOptions, so server.cors (and preview.cors, which inherits it) default to the loopback-origins regex, not false.

The published docs already document this default (server-options.md), only the JSDoc lagged. This updates the annotation to match.

@sapphi-red sapphi-red changed the title docs(server): fix incorrect @default for server.cors docs: fix incorrect @default for server.cors Jul 6, 2026
@sapphi-red sapphi-red added the documentation Improvements or additions to documentation label Jul 6, 2026
@sapphi-red sapphi-red merged commit 70435b2 into vitejs:main Jul 6, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants