Skip to content

Duplicated content-type response header on error response #27887

@siosio

Description

@siosio

version

  • Spring Boot 2.6.2

code

@SpringBootApplication
class FluxErrorHandlingApplication

fun main(args: Array<String>) {
    runApplication<FluxErrorHandlingApplication>(*args)
}

@Configuration
class Config {
    @Bean
    fun router(handler: Handler) =
        org.springframework.web.reactive.function.server.router {
            GET("/error", handler::handle)
        }
}

@Component
class Handler {
    fun handle(request: ServerRequest): Mono<ServerResponse> {
        throw RuntimeException()
    }
}

result

curl -v localhost:8080/error                                                                                                                                                                             master ✭ ✚ ✱
*   Trying 127.0.0.1:8080...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /error HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.68.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 500 Internal Server Error
< Content-Type: application/json
< Content-Type: application/json
< Content-Length: 131

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