Skip to content

auto judge scheme of specs_url#599

Open
adolli wants to merge 1 commit into
noirbizarre:masterfrom
adolli:master
Open

auto judge scheme of specs_url#599
adolli wants to merge 1 commit into
noirbizarre:masterfrom
adolli:master

Conversation

@adolli
Copy link
Copy Markdown

@adolli adolli commented Mar 1, 2019

fix API specs page MixedContentError when served over https.

image

fix API spec page served over https.
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.002%) to 96.847% when pulling d14c1a8 on adolli:master into a8f3582 on noirbizarre:master.

Comment thread flask_restplus/api.py
'''
return url_for(self.endpoint('specs'), _external=True)
_scheme = request.headers.get('x-forwarded-proto', 'http')
return url_for(self.endpoint('specs'), _external=True, _scheme=_scheme)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I just hit the same issue and resolved it with monkey patching _scheme='', similarly to the suggestion in #565. What's the advantage of using the approach in this PR versus setting _scheme='' to get a protocol-relative URL?

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.

3 participants