Skip to content

Webflux UI Behind the Proxy #1645

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

Closed
wiiitek opened this issue May 4, 2022 · 1 comment · Fixed by #1646
Closed

Webflux UI Behind the Proxy #1645

wiiitek opened this issue May 4, 2022 · 1 comment · Fixed by #1646
Labels
enhancement New feature or request

Comments

@wiiitek
Copy link

wiiitek commented May 4, 2022

Describe the bug

For Springdoc UI behind the proxy I have created some automated tests.

They helped me to understand, that based on the X-Forwarded-Prefix header following are updated automatically:

  • the configUrl path returned in swagger-initializer.js
  • the openapi definition url (and also configUrl) path returned at config URL location
  • oauth2RedirectUrl returned at config URL location

To Reproduce

I have tested it for org.springdoc:springdoc-openapi-ui:1.6.7.

I didn't test it, but prepared automated tests for 1.x and 2.x versions:

  • org.springdoc:springdoc-openapi-webflux-ui:1.6.9-SNAPSHOT - red
  • org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.0-M3-SNAPSHOT - green
  • org.springdoc:springdoc-openapi-starter-webflux-ui:2.0.0-M3-SNAPSHOT - red

Expected behavior

  • It should be possible to host webflux version of springdoc behind the proxy:
    • X-Forwarded-Prefix should be supported
    • or the tests should be updated to show how to configure sprindoc + webflux behind the proxy

Additional context

Related to issues: #534, #331, #153.

I also noticed that there is difference between ui paths for webmvc and webflux versions:

  • /swagger-ui/index.html for webmvc
  • /webjars/swagger-ui/index.html for webflux

Not sure if it is possible to have both at the same time, but if not, then maybe it would be better to have the same default (for version 2.x)?

@bnasslahsen
Copy link
Collaborator

@wiiitek,

For the difference between ui paths for webmvc and webflux version, it's normal and explained here #24

Not sure, there is an easy way to get this convergence of paths.
But you have a proposal, feel free to propose a PR.

@bnasslahsen bnasslahsen added the enhancement New feature or request label May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants