KEMBAR78
Support setting Spring.webflux.base-path and supporting it in path predicate by Guofuyinan · Pull Request #2984 · spring-cloud/spring-cloud-gateway · GitHub
Skip to content

Conversation

@Guofuyinan
Copy link
Contributor

Fix Bug : Setting Spring.webflux.base-path All Path Predicates Return 404 Results

Issues :
New Issue : #2944
Three Years Ago Issue : #1759

@pivotal-cla
Copy link

@Guofuyinan Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link

@Guofuyinan Thank you for signing the Contributor License Agreement!

Copy link
Member

@spencergibb spencergibb left a comment

Choose a reason for hiding this comment

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

please add a test

@Guofuyinan
Copy link
Contributor Author

Guofuyinan commented Jun 20, 2023

please add a test

I will add a test ASAP

@Guofuyinan Guofuyinan force-pushed the main branch 4 times, most recently from 920d2ab to 1ceaee8 Compare June 21, 2023 03:02
@spencergibb
Copy link
Member

Looks like some checkstyle issues.

@Guofuyinan
Copy link
Contributor Author

Looks like some checkstyle issues.

Try again

@scott-avery
Copy link

@spencergibb any update?

@spencergibb spencergibb changed the title Fix Bug : Setting Spring.webflux.base-path All Path Predicates Return 404 Results Support setting Spring.webflux.base-path and supporting it in path predicate Mar 11, 2024
@spencergibb
Copy link
Member

We will get this included in the 2024.0 release train.

@Wangluyao99
Copy link

We will get this included in the 2024.0 release train.

@spencergibb any update?

@spencergibb
Copy link
Member

Fixes #1759

@Guofuyinan Guofuyinan closed this Jan 16, 2025
@Guofuyinan
Copy link
Contributor Author

Extract variables

@Guofuyinan
Copy link
Contributor Author

@ryanjbaxter Any progress or anything I can do?

@ryanjbaxter
Copy link
Contributor

Can you submit this against the 4.2.x branch?

@Guofuyinan Guofuyinan changed the base branch from main to 4.2.x April 17, 2025 16:36
@Guofuyinan Guofuyinan changed the base branch from 4.2.x to main April 17, 2025 16:38
…edicate

Signed-off-by: 郭付一男 <guofuyinan@gmail.com>
@Guofuyinan Guofuyinan changed the base branch from main to 4.2.x April 17, 2025 16:50
@Guofuyinan
Copy link
Contributor Author

Can you submit this against the 4.2.x branch?

i have changed the base to 4.2.x branch

@ryanjbaxter
Copy link
Contributor

One final thing, could you add a note to the documentation that this setting will impact the path predicate?

@Guofuyinan
Copy link
Contributor Author

One final thing, could you add a note to the documentation that this setting will impact the path predicate?

Sorry, I found that there is no webflux related content under the docs of spring-cloud:4.2.x branch, while the main branch has it. Should I cherry-pick from the spring-cloud:main branch and modify it?

If so, I plan to add the note to the 'The Path Route Predicate Factory' section in request-predicates-factories.adoc file.

@Guofuyinan Guofuyinan requested a review from ryanjbaxter April 21, 2025 14:08
@ryanjbaxter
Copy link
Contributor

I was just envisioning adding a note to the path predicate documentation that setting spring.webflux.base-path would influence he path. Were you thinking something else?

@Guofuyinan
Copy link
Contributor Author

request-predicates-factories.adoc

Do you mean adding the note to the JavaDoc of org.springframework.cloud.gateway.route.RouteDefinition#predicates?
That sounds like a good approach for now.

I also think it would be helpful to include a note in the request-predicates-factories.adoc file as well.

We can definitely do this after the merge — I’d be happy to follow up on that.

@ryanjbaxter
Copy link
Contributor

I was thinking specifically here
https://github.com/spring-cloud/spring-cloud-gateway/blob/4.2.x/docs/modules/ROOT/pages/spring-cloud-gateway/request-predicates-factories.adoc#the-path-route-predicate-factory.

It would be good to have this documented before we merge it so everything is in one PR

Signed-off-by: 郭付一男 <guofuyinan@gmail.com>
@Guofuyinan
Copy link
Contributor Author

I was thinking specifically here https://github.com/spring-cloud/spring-cloud-gateway/blob/4.2.x/docs/modules/ROOT/pages/spring-cloud-gateway/request-predicates-factories.adoc#the-path-route-predicate-factory.

It would be good to have this documented before we merge it so everything is in one PR

I've updated the documentation as suggested at the specific location you mentioned (request-predicates-factories.adoc#the-path-route-predicate-factory).

Added a paragraph explaining how the spring.webflux.base-path property influences path matching. The documentation now clearly states that this property value will be automatically prepended to path patterns, with an example included.

@ryanjbaxter ryanjbaxter merged commit 034022b into spring-cloud:4.2.x Apr 22, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants