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

Serving the Swagger UI over HTTPS fails #193

Closed
lysnikolaou opened this issue Nov 9, 2020 · 5 comments
Closed

Serving the Swagger UI over HTTPS fails #193

lysnikolaou opened this issue Nov 9, 2020 · 5 comments
Labels
bug Something isn't working fix confirmation pending issue has been fixed and confirmation from issue reporter is pending

Comments

@lysnikolaou
Copy link

Hey hey,

thanks for the awesome work you've been doing 🚀. We have encountered an error, that we think is related to how drf-spectacular serves the schema as HTML.

Describe the bug
Trying to access the Swagger UI on our staging system, which can only be accessed through HTTPS, fails with

Errors
 
Fetch errorFailed to fetch http://<URL>/schema
Fetch errorPossible mixed-content issue? The page was loaded over https:// but a http:// URL was specified. Check that you are not attempting to load mixed content.

Expected behavior
We'd expect that we could deploy our docs and serve it over HTTPS without problems.

@tfranzel
Copy link
Owner

tfranzel commented Nov 9, 2020

hey! this was likely introduced due to #173 . i will have a look later today.

@tfranzel tfranzel added the bug Something isn't working label Nov 9, 2020
@tfranzel
Copy link
Owner

@lysnikolaou can you confirm that this works for you? pretty sure it should. would do a minor release afterwards

@lysnikolaou
Copy link
Author

lysnikolaou commented Nov 10, 2020

Hey @tfranzel, thanks for the quick response! Unfortunately, pip installing the master branch from this repo does not resolve the issue.

@tfranzel
Copy link
Owner

thanks for checking it out so quickly. i'm a bit puzzled here. i made all rendered urls relative so no http/s mixing should be going on for swagger ui. are you certain your install has the most-recent master?

pip install git+git://github.com/tfranzel/drf-spectacular.git@26273bb9ae33c6865bd0df9fa07ad19daa45175a

to be sure but pip install -U ....@master should be the same (+1 unrelated commit).

@tfranzel tfranzel added the fix confirmation pending issue has been fixed and confirmation from issue reporter is pending label Nov 13, 2020
@lysnikolaou
Copy link
Author

Yup, it must have been some wrong configuration on my part. Upgrading to 0.11.1 fixes this. Thanks a bunch for the quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix confirmation pending issue has been fixed and confirmation from issue reporter is pending
Projects
None yet
Development

No branches or pull requests

2 participants