1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 01:06:17 +02:00

Merge pull request #1128 from dmach/http-accept

Send HTTP header Accept: application/xml
This commit is contained in:
Daniel Mach 2022-09-05 13:59:48 +02:00 committed by GitHub
commit 6a1e8053ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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