Skip to content

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

@redapel

Description

@redapel

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.

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions