Skip to content

When no API version is provided, /error requests also fail. #36058

@ghoonch4

Description

@ghoonch4

I am experimenting with the API Versioning feature introduced in Spring 7.
When I send a request without specifying an API version, I receive an empty response body, as shown below:

~ > curl -XGET localhost:8080/foo/bar -i
HTTP/1.1 400
Content-Length: 0
Date: Sat, 20 Dec 2025 18:17:10 GMT
Connection: close

According to the following code:

https://github.com/spring-projects/spring-framework/blame/0b2bb7e751d5effd798adaf545c64a7342657ecc/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMapping.java#L542

the /foo/bar request fails in the initApiVersion(request) method.
The subsequent /error request also fails at the same point and never reaches the ErrorController, which is responsible for generating the response body.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: webIssues in web modules (web, webmvc, webflux, websocket)status: 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