From c3dc7fa0bd1ef3e2a069f63eb52da1dd8a4bc184 Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Wed, 27 Nov 2013 16:50:50 +0530 Subject: [PATCH] [fix] https issue in request url --- webnotes/utils/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webnotes/utils/__init__.py b/webnotes/utils/__init__.py index 9a0f11ae86..90ed6bbf24 100644 --- a/webnotes/utils/__init__.py +++ b/webnotes/utils/__init__.py @@ -70,7 +70,7 @@ def get_request_site_address(full_address=False): if not host_name: if webnotes.request: - protocol = 'HTTPS' in webnotes.get_request_header('SERVER_PROTOCOL', "") and 'https://' or 'http://' + protocol = 'https' == webnotes.get_request_header('X-Forwarded-Proto', "") and 'https://' or 'http://' host_name = protocol + webnotes.request.host else: return "http://localhost" @@ -925,4 +925,4 @@ def expand_partial_links(html): url = get_url() if not url.endswith("/"): url += "/" return re.sub('(href|src){1}([\s]*=[\s]*[\'"]?)((?!http)[^\'" >]+)([\'"]?)', - '\g<1>\g<2>{}\g<3>\g<4>'.format(url), html) \ No newline at end of file + '\g<1>\g<2>{}\g<3>\g<4>'.format(url), html)