mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-27 10:16:14 +01:00
- check if the apiurl has a protocol (this partly fixes #478516)
This commit is contained in:
parent
caae2bc8a1
commit
0d25a44e54
@ -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])
|
||||
|
Loading…
Reference in New Issue
Block a user