Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mvc gateway rewritePath filter overwrites GATEWAY_REQUEST_URL_ATTR attribute #3055

Closed
giger85 opened this issue Sep 18, 2023 · 3 comments
Closed
Labels
Milestone

Comments

@giger85
Copy link
Contributor

giger85 commented Sep 18, 2023

Hi, I am testing spring cloud gateway mvc.

Describe the bug
When RewritePath filter applied, then this filter overwrites GATEWAY_REQUEST_URL_ATTR attribute.
In ProxyExchangeHandlerFunction, resolved uri is unexpected value.

Below code might be root cause.

Sample

  • application.yaml
spring.cloud.gateway.mvc:
  routes:
    - id: listRoute1
      uri: https://examplel1.com
      predicates:
        - name: Method
          args:
            methods: GET
        - name: Path
          args:
            pattern: /foo/mytest
      filters:
        - RewritePath=/foo/(?<segment>.*),/bar/${segment}
  • curl test
> curl 'http://localhost:8080/foo/mytest'
  • expected
https://examplel1.com/bar/mytest
  • actual
http://localhost:8080/bar/mytest
@manzhizhen
Copy link
Contributor

I understand is ProxyExchangeHandlerFunction routing path from GATEWAY_REQUEST_URL_ATTR resolution to really, it's not meet your expectations?

@giger85
Copy link
Contributor Author

giger85 commented Oct 16, 2023

@manzhizhen
Yes, it does not meet expectation.
If the official document is provided in near future, then I will check again.

@giger85
Copy link
Contributor Author

giger85 commented Dec 22, 2023

@spencergibb
Thanks for your support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants