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

ServletServerHttpRequest getHeaders() throws IllegalArgumentException instead of ignoring invalid content type */* #27957

Closed
redapel opened this issue Jan 20, 2022 · 0 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Milestone

Comments

@redapel
Copy link

redapel commented Jan 20, 2022

Spring Boot version 2.6.2

repo link

Curl command:

curl localhost:8080/headers -H "Content-type:\*/\*"

Inside /headers method endpoint, when using ServletServerHttpRequest getHeaders() method produce the following result.

Actual result: java.lang.IllegalArgumentException: Content-Type cannot contain wildcard type '*'

Expected result: Exception should be ignored like what the comment say in the source code.

// Ignore: simply not exposing an invalid content type in HttpHeaders...

We cannot prevent someone out there to not craft this kind of curl command request.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 20, 2022
@sbrannen sbrannen changed the title ServletServerHttpRequest getHeaders() method throwing IllegalArgumentException instead of being ignored on an invalid content type */*. ServletServerHttpRequest getHeaders() throws IllegalArgumentException instead of ignoring invalid content type */* Jan 20, 2022
@sbrannen sbrannen added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Jan 20, 2022
@sbrannen sbrannen added this to the Triage Queue milestone Jan 20, 2022
@rstoyanchev rstoyanchev self-assigned this Jan 24, 2022
@rstoyanchev rstoyanchev modified the milestones: Triage Queue, 5.3.16 Jan 24, 2022
@rstoyanchev rstoyanchev added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jan 24, 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: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants