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

Added redirects in the warp servers from /swagger-ui to /swagger-ui/ #171

Merged
merged 1 commit into from
Jun 14, 2022
Merged

Added redirects in the warp servers from /swagger-ui to /swagger-ui/ #171

merged 1 commit into from
Jun 14, 2022

Conversation

Swandog
Copy link
Contributor

@Swandog Swandog commented Jun 14, 2022

Extra info:
in the warp examples, http://localhost:8080/swagger-ui doesn't work, but http://localhost:8080/swagger-ui/ does. Unfortunately, there doesn't seem to be a simple way to enforce that in warp (see seanmonstar/warp#584), so I added a manual redirect. This way, future warp users will be aware of this pitfall.

Commit message follows:
The ui only works if you go to /swagger-ui/ with a tailing /.
If you browse to /swagger-ui, you get an unhelpful blank page,
due to the relative links for JS, CSS, et al files.
My investigation indicates that the best way to fix this in warp
is to manually create a redirect.
So I updated the warp examples to have this
(I am unsure if the other servers have the same problem)

I considered using a regex on the full path
instead of passing in both the path and tail,
but I decided passing along two strings was more efficient than
running a full regex every time

The ui only works if you go to `/swagger-ui/` with a tailing `/`.
If you browse to `/swagger-ui`, you get an unhelpful blank page,
due to the relative links for JS, CSS, et al files.
My investigation indicates that the best way to fix this in `warp`
is to manually create a redirect.
So I updated the `warp` examples to have this
(I am unsure if the other servers have the same problem)

I considered using a regex on the full path
instead of passing in both the path and tail,
but I decided passing along two strings was more efficient than
running a full regex every time
Copy link
Owner

@juhaku juhaku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome 🚀 This goodie is needed.

@juhaku juhaku merged commit 39c1a50 into juhaku:master Jun 14, 2022
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.

2 participants