Skip to content

Support explicit OPTIONS routes#1185

Open
liborch wants to merge 1 commit into
CrowCpp:masterfrom
liborch:support-explicit-options-routes
Open

Support explicit OPTIONS routes#1185
liborch wants to merge 1 commit into
CrowCpp:masterfrom
liborch:support-explicit-options-routes

Conversation

@liborch

@liborch liborch commented May 15, 2026

Copy link
Copy Markdown

Allows explicitly registered OPTIONS routes to handle Local Network Access (LNA) preflight requests.

Currently, the automatic OPTIONS fallback is used before a concrete OPTIONS route can be matched. With this change, explicit OPTIONS routes take precedence, while the existing automatic "/*" handling is preserved.

@gittiver

Copy link
Copy Markdown
Member

I don't see a need for explicit OPTION routes, they are handled by the automatic fallback, there is no content in body, what shall be achieved here?

@liborch

liborch commented Jun 9, 2026

Copy link
Copy Markdown
Author

Standard CrowCpp handling does not make Chrome happy if you want access local network like WebSocket running on localhost. It requires return e.g. Access-Control-Allow-Private-Network: true.
This patch gives you a chance to write your own handler that will fulfill Chrome's needs and will be more flexible than CrowCpp release cycle.

@gittiver

Copy link
Copy Markdown
Member

I would assume this is already possible via Cors Handler middleware.
see: https://github.com/CrowCpp/Crow/blob/master/examples/middlewares/example_cors.cpp

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.

2 participants