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

Fix Incorrect Pagination Links in Microservices When Forwarded Through Gateway #27432

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

yhao3
Copy link
Contributor

@yhao3 yhao3 commented Sep 28, 2024

Description

Fixes #27354

  1. Set the server.forward-headers-strategy to FRAMEWORK in application.yml for microservice applications, applicable across all environments.
  2. Based on the documentation for ForwardedHeaderUtils, it is recommended to use org.springframework.web.filter.ForwardedHeaderFilter for Spring MVC or org.springframework.web.server.adapter.ForwardedHeaderTransformer to extract information from headers as early as possible and discard them. As a result, I updated the logic for generating pagination HTTP headers by removing the direct usage of ForwardedHeaderUtils.
  3. The SpringDocConfiguration is no longer needed since setting server.forward-headers-strategy to FRAMEWORK will automatically handle the parsing of the X-Forwarded-Prefix header.

Please make sure the below checklist is followed for Pull Requests.

When you are still working on the PR, consider converting it to Draft (below reviewers) and adding skip-ci label, you can still see CI build result at your branch.

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.

Incorrect Pagination Links in Microservices When Forwarded Through Gateway
1 participant