Feature/swagger ui behind proxy#596
Open
adroffner wants to merge 4 commits intonoirbizarre:masterfrom
Open
Conversation
added 4 commits
February 25, 2019 22:32
…ript to be viewed from behind a proxy.
…to generate the relative URL.
|
I really hope this pull request is merged. There's hack I keep copying from project to project just to apps work behind proxies.😂 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This branch adds a behind_proxy=True keyword parameter to the flask_restplus.api.Api(..., behind_proxy=True) object. Many users need a reverse proxy like nginx to serve the REST API. In my case, I had to place the server inside a kubernetes pod & keep its port number.
I added appropriate unit tests to the test_api.py file. It considers both cases when behind_proxy is either True or False. I assume that SERVER_NAME is set & has a defined port.
OTHER ISSUES: I did not want to fix these in this branch & make it change too much
pip install wheelto make theinvoke distwork, which is not listed in the requirements directory.invoke assetsbeforeinvoke distso that the Swagger UI javascript gets into the wheelinvoke qashows many mccabe complexity violations (C901 flake8 warnings) that stop the buildThe C901 complexity warnings mean no one can just run
inv allto complete a build :(