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

Reactive HTTP request CORS Support [SPR-14545] #19113

Closed
spring-projects-issues opened this issue Jul 30, 2016 · 3 comments
Closed

Reactive HTTP request CORS Support [SPR-14545] #19113

spring-projects-issues opened this issue Jul 30, 2016 · 3 comments

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Jul 30, 2016

Rossen Stoyanchev opened SPR-14545 and commented


Affects: 5.0 M1

Issue Links:

  • #19360 Fix HttpRequest#getURI() with Netty based engines ("depends on")

Referenced from: commits e31a2f7

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Sep 27, 2016

Sébastien Deleuze commented

Rossen Stoyanchev I am currently porting the Spring MVC CORS implementation to Spring Web Reactive, and I try to figure out how create a Reactive equivalent of the dynamic insertion of a CORS interceptor like implemented here in Spring MVC. We do have WebFilter, WebHttpHandlerBuilder and FilteringWebHandler classes on Reactive side that allow to do similar stuff, but they seems not designed to be used where the handler to filter is an Object (and not an WebHandler).

Maybe I could just store a CORS configuration exchange attribute, and configure a static filter in WebReactiveConfiguration that could in turn call the reactive CorsProcessor if needed based on this attribute?

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Sep 27, 2016

Rossen Stoyanchev commented

Good point. Looking at the existing AbstractHandlerMapping the PreFlightHandler and CorsInterceptor do nothing but delegate to the CorsProcessor and that happens immediately after the HandlerMapping returns. Why don't we try and invoke the CorsProcessor directly from the HandlerMapping and the return either the matched handler or a no-op WebHandler depending on the outcome of the check and whether we should continue.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Sep 29, 2016

Sébastien Deleuze commented

I have implemented something along these lines, see this draft PR for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants