Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Patch request URL for fake HTTPS
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Aug 17, 2015
1 parent 522de27 commit 7388990
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion coil/web.py
Expand Up @@ -345,7 +345,11 @@ def render(template_name, context=None, code=200, headers=None):
context['current_user'] = current_user
context['_author_get'] = _author_get
context['_author_uid_get'] = _author_uid_get
context['permalink'] = request.url
if app.config['COIL_URL'].startswith('https') and not request.url.startswith('https'):
# patch request URL for HTTPS proxy (eg. CloudFlare)
context['permalink'] = request.url.replace('http', 'https', 1)
else:
context['permalink'] = request.url
context['url_for'] = url_for
headers['Pragma'] = 'no-cache'
headers['Cache-Control'] = 'private, max-age=0, no-cache'
Expand Down

0 comments on commit 7388990

Please sign in to comment.