fix: detect x-forwarded-proto if deployed behind proxy

For static files handling, was set up in "oas_ui()"
This commit is contained in:
jar3b 2020-11-25 16:25:04 +03:00
parent 5567d73952
commit 6211c71875

View File

@ -172,6 +172,8 @@ async def oas_ui(request):
static_url = request.app.router["static"].url_for(filename="")
spec_url = request.app.router["spec"].url_for()
if request.scheme != request.headers.get('x-forwarded-proto', request.scheme):
request = request.clone(scheme=request.headers['x-forwarded-proto'])
host = request.url.origin()
return Response(