mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-23 02:32:13 +01:00
Send HTTP header Accept: application/xml
Rails sends a html response if the header is not set https://github.com/openSUSE/open-build-service/pull/13019
This commit is contained in:
parent
cedc7c006f
commit
c602d08453
@ -3420,6 +3420,10 @@ def http_request(method, url, headers={}, data=None, file=None):
|
|||||||
|
|
||||||
req.get_method = lambda: method
|
req.get_method = lambda: method
|
||||||
|
|
||||||
|
# Rails sends a html response if the header is not set
|
||||||
|
# https://github.com/openSUSE/open-build-service/pull/13019
|
||||||
|
req.add_header("Accept", "application/xml")
|
||||||
|
|
||||||
# POST requests are application/x-www-form-urlencoded per default
|
# POST requests are application/x-www-form-urlencoded per default
|
||||||
# but sending data requires an octet-stream type
|
# but sending data requires an octet-stream type
|
||||||
if method == 'PUT' or (method == 'POST' and (data or file)):
|
if method == 'PUT' or (method == 'POST' and (data or file)):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user