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 handling of forwarded headers and servlet context path for swagger ui #60

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

groldan
Copy link
Member

@groldan groldan commented Mar 29, 2024

In order for the swagger ui to automatically respect the X-Forwarded-Prefix header, the config property
server.forward-headers-strategy must be framework when using Tomcat.

Additionally, the spring-doc swagger-ui won't respect the servlet context path (i.e. /acl) when building URLs and the X-Forwarded-Prefix is received (and handled by
org.springframework.web.filter.ForwardedHeaderFilter as result of server.forward-headers-strategy=framework.

This patch handles the servlet context suffixing at SpringDocHomeRedirectController and SpringDocAutoConfiguration.

…r ui

In order for the swagger ui to automatically respect the
`X-Forwarded-Prefix` header, the config property
`server.forward-headers-strategy` must be `framework` when using Tomcat.

Additionally, the spring-doc swagger-ui won't respect the servlet
context path (i.e. `/acl`) when building URLs and the
`X-Forwarded-Prefix` is received (and handled by
`org.springframework.web.filter.ForwardedHeaderFilter` as result of
`server.forward-headers-strategy=framework`.

This patch handles the servlet context suffixing at
`SpringDocHomeRedirectController` and `SpringDocAutoConfiguration`.
@groldan groldan merged commit c9e36ce into geoserver:main Mar 29, 2024
4 checks passed
@groldan groldan deleted the forwarded_headers branch March 29, 2024 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant