mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-28 02:36:15 +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
|
import urlparse
|
||||||
if apisrv.startswith('http://') or apisrv.startswith('https://'):
|
if apisrv.startswith('http://') or apisrv.startswith('https://'):
|
||||||
return urlparse.urlsplit(apisrv)[0:2]
|
return urlparse.urlsplit(apisrv)[0:2]
|
||||||
else:
|
elif scheme != None:
|
||||||
return scheme, apisrv
|
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):
|
def urljoin(scheme, apisrv):
|
||||||
return '://'.join([scheme, apisrv])
|
return '://'.join([scheme, apisrv])
|
||||||
|
Loading…
Reference in New Issue
Block a user