mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-10 06:46:15 +01:00
- backport fix from oauth branch: if we POST data the content-type should be "application/octet-stream" otherwise it will lead to strange errors when POSTing cpio archives
This commit is contained in:
parent
2d3be21964
commit
e95e8438e4
@ -1767,7 +1767,7 @@ def http_request(method, url, headers={}, data=None, file=None, timeout=100):
|
||||
|
||||
# POST requests are application/x-www-form-urlencoded per default
|
||||
# since we change the request into PUT, we also need to adjust the content type header
|
||||
if method == 'PUT':
|
||||
if method == 'PUT' or (method == 'POST' and data):
|
||||
req.add_header('Content-Type', 'application/octet-stream')
|
||||
|
||||
if type(headers) == type({}):
|
||||
|
Loading…
Reference in New Issue
Block a user