Skip to content
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

Access-Control-Allow-Methods not always set correctly #33

Open
frenchy64 opened this issue Nov 4, 2021 · 1 comment
Open

Access-Control-Allow-Methods not always set correctly #33

frenchy64 opened this issue Nov 4, 2021 · 1 comment

Comments

@frenchy64
Copy link

Due to some quirks of HeaderMap, if Access-Control-Allow-Methods is already present in a request, in some cases the the CORS headers are not correctly set.

See test cases in this branch and proposed fix: https://github.com/frenchy64/ring-cors/pull/1/files

@frenchy64 frenchy64 changed the title Access-Control-Allow-Methods not always overridden correctly Access-Control-Allow-Methods not always set correctly Nov 4, 2021
@ejschoen
Copy link

I just ran into this--after upgrading a large app to ring 1.11.0. When the response contains a clj-http.headers/HeaderMap, the Access-Control-Allow-Methods header gets returned from the CORs middleware as e.g., #{:get :post} rather then "GET< POST", and the ring-jetty-adapter's ring.util.jakarta.servlet/set-headers code can't handle it, and throws a ClassCastException.

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

No branches or pull requests

2 participants