Merge pull request #5904 from netchampfaris/get-url-fix

Pick port from webserver_port in get_url
This commit is contained in:
Prateeksha Singh 2018-08-01 12:50:52 +05:30 committed by GitHub
commit 189cea3339
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -713,8 +713,10 @@ def get_url(uri=None, full_address=False):
if not uri and full_address:
uri = frappe.get_request_header("REQUEST_URI", "")
if frappe.conf.http_port:
host_name = host_name + ':' + str(frappe.conf.http_port)
port = frappe.conf.http_port or frappe.conf.webserver_port
if host_name and ':' not in host_name and port:
host_name = host_name + ':' + str(port)
url = urljoin(host_name, uri) if uri else host_name