1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 14:56:14 +01:00

- check if the apiurl has a protocol (this partly fixes #478516)

This commit is contained in:
Marcus Hüwe 2009-02-24 01:29:17 +00:00
parent caae2bc8a1
commit 0d25a44e54

View File

@ -141,8 +141,12 @@ def parse_apisrv_url(scheme, apisrv):
import urlparse
if apisrv.startswith('http://') or apisrv.startswith('https://'):
return urlparse.urlsplit(apisrv)[0:2]
else:
elif scheme != None:
return scheme, apisrv
else:
from urllib2 import URLError
msg = 'invalid apiurl \'%s\' (specify the protocol (http:// or https://))' % apisrv
raise URLError(msg)
def urljoin(scheme, apisrv):
return '://'.join([scheme, apisrv])