fix: frappe.utils.get_url
This commit is contained in:
parent
e3b7d26e70
commit
73c7984fcd
1 changed files with 5 additions and 1 deletions
|
|
@ -728,13 +728,17 @@ def get_url(uri=None, full_address=False):
|
|||
|
||||
port = frappe.conf.http_port or frappe.conf.webserver_port
|
||||
|
||||
if host_name and ':' not in host_name and port:
|
||||
if host_name and not url_contains_port(host_name) and port:
|
||||
host_name = host_name + ':' + str(port)
|
||||
|
||||
url = urljoin(host_name, uri) if uri else host_name
|
||||
|
||||
return url
|
||||
|
||||
def url_contains_port(url):
|
||||
parts = url.split(':')
|
||||
return len(parts) > 2
|
||||
|
||||
def get_host_name():
|
||||
return get_url().rsplit("//", 1)[-1]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue