Skip to content

Adds StripContextPath filter [webflux]#4129

Open
garvit-joshi wants to merge 1 commit intospring-cloud:mainfrom
garvit-joshi:main
Open

Adds StripContextPath filter [webflux]#4129
garvit-joshi wants to merge 1 commit intospring-cloud:mainfrom
garvit-joshi:main

Conversation

@garvit-joshi
Copy link
Copy Markdown
Contributor

closes: #1935

Signed-off-by: Garvit Joshi <garvitjoshi9@gmail.com>
newPath = "/";
}

ServerHttpRequest newRequest = request.mutate().contextPath("").path(newPath).build();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a big fan of setting things to an empty string. Does null work here instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried null, but it does not compile here. contextPath(...) is treated as non-null and NullAway fails the build with:

passing @Nullable parameter 'null' where @NonNull is required

So I kept contextPath("") for now.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, the field in the builder is nullable and in the constructor but not the builder method. @rstoyanchev is that an oversight?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support webflux.base-path in StripFilter and possibly others

3 participants