Commit a6f7c96b authored by Lucas Carvalho's avatar Lucas Carvalho

Now if you have the url defined as localhost:9181/test_client it will return...

Now if you have the url defined as localhost:9181/test_client it will return the correct url including the protocol.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36447 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a4e04f75
......@@ -55,8 +55,6 @@ class UrlMixIn:
url_string = self.getUrlString()
if not url_string:
return None
if urllib.splittype(url_string)[0]:
return url_string
protocol = self.getUrlProtocol()
if not protocol:
# A quick fix for all objects which did not
......@@ -66,8 +64,13 @@ class UrlMixIn:
protocol = default_protocol_dict[ptype]
else:
protocol = 'http'
if protocol in no_host_protocol_list or url_string.startswith('//'):
return '%s:%s' % (protocol, url_string)
if url_string.startswith(protocol):
return url_string
return '%s://%s' % (protocol, url_string)
security.declareProtected(Permissions.ModifyPortalContent, 'fromText')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment