-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x.vweb: add cors middleware #20713
x.vweb: add cors middleware #20713
Conversation
How will multiple origin cors works? |
Good suggestion, I can make the origin into an array. From the MDN docs:
|
Yes should allow a list of hosts, and return the requested origin(even when the allowed host is *). |
@Casper64 , please run |
Co-authored-by: JalonSolov <JalonSolov@gmail.com>
Sorry, it was easier for me to do it. |
fix for #20708
This pr adds a middleware function in x.vweb to handle CORS requests.
It also includes a small test and a modified example of
examples/vweb/cors
CORS request can be traced by adding
-d vweb_trace_cors
when you compileUsage
You only need to add
vweb.cors
as middleware to your app and configure CORSExample: