Skip to content

Fix CORS option documentation to match actual behavior#925

Merged
jelveh merged 1 commit intomasterfrom
fix-cors-documentation
Sep 21, 2025
Merged

Fix CORS option documentation to match actual behavior#925
jelveh merged 1 commit intomasterfrom
fix-cors-documentation

Conversation

@jelveh
Copy link
Copy Markdown
Contributor

@jelveh jelveh commented Sep 21, 2025

The --cors flag documentation incorrectly stated it controls the value of Access-Control-Allow-Origin, when in reality it always sets it to '*'. The optional parameter value actually adds to Access-Control-Allow-Headers, not Access-Control-Allow-Origin.

This commit corrects the documentation to accurately describe the behavior:

  • --cors enables CORS by setting Access-Control-Allow-Origin to '*'
  • --cors='header1,header2' adds custom headers to Access-Control-Allow-Headers
Relevant issues

Fixes #856

Contributor checklist
  • Provide tests for the changes (unless documentation-only)
  • Documented any new features, CLI switches, etc. (if applicable)
    • Server --help output
    • README.md
    • doc/http-server.1 (use the same format as other entries)
  • The pull request is being made against the master branch

The `--cors` flag documentation incorrectly stated it controls the value
of `Access-Control-Allow-Origin`, when in reality it always sets it to '*'.
The optional parameter value actually adds to `Access-Control-Allow-Headers`,
not `Access-Control-Allow-Origin`.

This commit corrects the documentation to accurately describe the behavior:
- `--cors` enables CORS by setting `Access-Control-Allow-Origin` to '*'
- `--cors='header1,header2'` adds custom headers to `Access-Control-Allow-Headers`
@jelveh jelveh merged commit fede783 into master Sep 21, 2025
29 of 30 checks passed
@jelveh jelveh deleted the fix-cors-documentation branch September 21, 2025 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--cors usage is incorrect in the documentation

1 participant