Replies: 5 comments 6 replies
-
I think https://github.com/quarkusio/quarkus/blob/main/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/cors/CORSFilter.java#L219 here needs to be another check if not only the origin is not allowed but also the method. |
Beta Was this translation helpful? Give feedback.
-
Hi @hamburml
Note for |
Beta Was this translation helpful? Give feedback.
-
@hamburml oh yes, you need to configure the filter with the list of allowed methods if you'd like to restrict |
Beta Was this translation helpful? Give feedback.
-
It can't just echo the incoming header value back |
Beta Was this translation helpful? Give feedback.
-
#33185 is merged |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello there!
I have a question about CORS with preflight/options request. Here is a short example: https://github.com/hamburml/quarkus-cors-example.
An app on localhost:3001 makes a POST request with custom header to another app developer with quarkus on localhost:8080. The custom header forces a preflight request (HTTP Header OPTIONS) which asks the localhost:8080 app if it is allowed to send a request with the custom header for example. Inside the quarkus app I set
quarkus.http.cors.methods=GET,DELETE
so requests with Methods POST should be disallowed.But that is not the case. Here is the screenshot of developer tools.

Access-control-request-method is set to POST but the status code is 200.
Quarkus config is here: https://github.com/hamburml/quarkus-cors-example/blob/main/quarkus_8080/src/main/resources/application.properties
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions