mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-24 22:06:14 +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
d9cb3c58ed
commit
c2d0b05ede
@ -268,6 +268,10 @@ def http_request(method, url, headers=None, data=None, file=None):
|
||||
if success:
|
||||
break
|
||||
|
||||
# Rails sends a html response if the header is not set
|
||||
# https://github.com/openSUSE/open-build-service/pull/13019
|
||||
headers.add("Accept", "application/xml")
|
||||
|
||||
if data or file:
|
||||
# osc/obs data is usually XML
|
||||
headers.add("Content-Type", "application/xml; charset=utf-8")
|
||||
|
Loading…
Reference in New Issue
Block a user