Skip to content
Permalink
Browse files

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 7388990c5c215f8795d456c501ace623c36180ef
Showing with 5 additions and 1 deletion.
  1. +5 −1 coil/web.py
@@ -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'

0 comments on commit 7388990

Please sign in to comment.
You can’t perform that action at this time.