Skip to content

SpringBoot 4.0.3, Spring webmvc 7.0.5, ResponseBodyEmitterReturnValueHandler duplicates headers when there is no emitter #36419

@jaxdax873-code

Description

@jaxdax873-code

In ResponseBodyEmitterReturnValueHandler method handleReturnValue
There is new logic when emitter is null

outputMessage.getHeaders().forEach((headerName, headerValues) -> {
                    for (String headerValue : headerValues) {
                        response.addHeader(headerName, headerValue);
                    }
                });

This place duplicate headers from outputMessage to response

In CORSE case it will create not valid response headers with duplicate.
Is it new logic or bug ? At the moment can be solved with Filters not allowing add duplicates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: webIssues in web modules (web, webmvc, webflux, websocket)status: feedback-reminderWe've sent a reminder that we need additional information before we can continuestatus: waiting-for-feedbackWe need additional information before we can continuestatus: waiting-for-triageAn issue we've not yet triaged or decided on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions