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

fix: cors filter should not store in local variable allowed origins #4687

Closed
yurem opened this issue Apr 19, 2023 · 0 comments · Fixed by #4940, #4941 or #5496
Closed

fix: cors filter should not store in local variable allowed origins #4687

yurem opened this issue Apr 19, 2023 · 0 comments · Fixed by #4940, #4941 or #5496
Assignees
Labels
kind-bug Issue or PR is a bug in existing functionality
Milestone

Comments

@yurem
Copy link
Contributor

yurem commented Apr 19, 2023

CorsFilter in doFilter method get allowed origins based on request and set them in AbstractCorsFilter.allowedOrigins before calling AbstractCorsFilter.doFilter. This is bad idea to pass them in such way because WebFilter is defined with asyncSupported = true. Hence second request can override this variable value. We can use:

request.setAttribute("clientAllowedOrigins", clientAllowedOrigins);

to pass client allowed origins to AbstractCorsFilter.doFilter

@yurem yurem self-assigned this Apr 19, 2023
@mo-auto mo-auto added the kind-bug Issue or PR is a bug in existing functionality label Apr 19, 2023
@moabu moabu added this to the 1.0.13 milestone May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind-bug Issue or PR is a bug in existing functionality
Projects
None yet
3 participants