Skip to content

Allow null contextPath in ServerHttpRequest.Builder - #37099

Closed
garvit-joshi wants to merge 1 commit into
spring-projects:mainfrom
garvit-joshi:fix/gh-37098-nullable-builder-contextpath
Closed

garvit-joshi wants to merge 1 commit into
spring-projects:mainfrom
garvit-joshi:fix/gh-37098-nullable-builder-contextpath

Conversation

@garvit-joshi

@garvit-joshi garvit-joshi commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

closes #37098

The builder method required a non-null contextPath while the underlying
field, MutatedServerHttpRequest constructor, and RequestPath.parse all
accept null and treat it the same as an empty string. Relax the method
parameter to @nullable so callers can clear the context path directly.

closes spring-projects#37098

Signed-off-by: Garvit Joshi <garvitjoshi9@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jul 31, 2026
@sbrannen sbrannen added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Aug 19, 2026
@rstoyanchev rstoyanchev self-assigned this Aug 20, 2026
@rstoyanchev rstoyanchev added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Aug 20, 2026
@rstoyanchev rstoyanchev added this to the 7.0.10 milestone Aug 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Fixed via 8d4208f

pull Bot pushed a commit to Clarence404/spring-framework that referenced this pull request Aug 24, 2026
garvit-joshi added a commit to garvit-joshi/spring-cloud-gateway that referenced this pull request Oct 4, 2026
ServerHttpRequest.Builder#contextPath accepts null since
spring-projects/spring-framework#37099 (Framework 7.1.0-M2), so the
context path is cleared with null instead of an empty string.

Signed-off-by: Garvit Joshi <garvitjoshi9@gmail.com>
@garvit-joshi
garvit-joshi deleted the fix/gh-37098-nullable-builder-contextpath branch October 4, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ServerHttpRequest.Builder.contextPath() does not accept null but the implementation is nullable

4 participants