1
0
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:
Daniel Mach 2022-09-05 09:01:04 +02:00
parent d9cb3c58ed
commit c2d0b05ede

View File

@ -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")