mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-13 17:16:23 +01:00
- common.py, __get_response: support "code" keyword argument to specify the http status code
This commit is contained in:
parent
5f5ae8e22d
commit
e1080aa476
@ -73,7 +73,7 @@ class MyHTTPHandler(urllib2.HTTPHandler):
|
|||||||
else:
|
else:
|
||||||
raise RuntimeError('either specify text or file')
|
raise RuntimeError('either specify text or file')
|
||||||
resp = urllib2.addinfourl(f, {}, url)
|
resp = urllib2.addinfourl(f, {}, url)
|
||||||
resp.code = 200
|
resp.code = kwargs.get('code', 200)
|
||||||
resp.msg = ''
|
resp.msg = ''
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user