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

Add PreFlightRequestWebFilter #26885

Closed
rwinch opened this issue Apr 30, 2021 · 1 comment
Closed

Add PreFlightRequestWebFilter #26885

rwinch opened this issue Apr 30, 2021 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@rwinch
Copy link
Member

rwinch commented Apr 30, 2021

Similar to CorsWebFilter there should be a PreFlightWebFilter in Spring Framework that leverages the PreFlightRequestHandler API.

Related gh-26257 spring-projects/spring-boot#24541

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 30, 2021
@rstoyanchev rstoyanchev self-assigned this May 4, 2021
@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels May 4, 2021
@rstoyanchev rstoyanchev added this to the 5.3.7 milestone May 4, 2021
@rstoyanchev
Copy link
Contributor

rstoyanchev commented May 4, 2021

We could a default method to PreFlightRequestHandler. Would that work for you @rwinch?

default WebFilter asWebFilter() {
	return (exchange, chain) -> 
			CorsUtils.isPreFlightRequest(exchange.getRequest()) ? 
					handlePreFlight(exchange) : chain.filter(exchange);
}

@rstoyanchev rstoyanchev changed the title Add PreFlightWebFilter Add PreFlightRequestWebFilter May 7, 2021
Zoran0104 pushed a commit to Zoran0104/spring-framework that referenced this issue Aug 20, 2021
lxbzmy pushed a commit to lxbzmy/spring-framework that referenced this issue Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants