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

WebFlux : Content-type header is written twice when an error occurs #29308

Closed
xavier-b opened this issue Jan 11, 2022 · 1 comment
Closed

WebFlux : Content-type header is written twice when an error occurs #29308

xavier-b opened this issue Jan 11, 2022 · 1 comment
Labels
for: external-project For an external project and not something we can fix status: duplicate A duplicate of another issue

Comments

@xavier-b
Copy link

Hi,

From Spring boot 2.6.2
When an error occurs, for example a simple 404 when no controller is registred for a path, the Content-type header is written twice.
Some http clients do not support having the content-type header twice and have an error.

λ curl -v http://localhost:8080/unknown
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 8080 (#0)
> GET /unknown HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.55.1
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Content-Type: application/json
< Content-Type: application/json
< Content-Length: 136
<
{"timestamp":"2022-01-11T13:22:29.038+00:00","path":"/unknown","status":404,"error":"Not Found","message":null,"requestId":"800357b9-1"}
* Connection #0 to host localhost left intact

This appears to be a problem created by this new behaviour of spring 5.3.14 : spring-projects/spring-framework#27741
spring-projects/spring-framework@2a5713f

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 11, 2022
@bclozel
Copy link
Member

bclozel commented Jan 11, 2022

Duplicates spring-projects/spring-framework#27887

@bclozel bclozel closed this as completed Jan 11, 2022
@bclozel bclozel added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 11, 2022
@wilkinsona wilkinsona added the for: external-project For an external project and not something we can fix label Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

4 participants