Skip to content

Webflux UI Behind the Proxy #1645

@wiiitek

Description

@wiiitek

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)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions