Skip to content

Commit b678d0a

Browse files
OmniTroidfilak-sap
authored andcommitted
client: Add application/atom+xml as valid MIME type
According to Microsoft, this is an acceptable MIME type for ODATA: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-odata/8ee3b8ba-478c-49c1-992e-4e5ffdcd62fd Some systems opt to use this kind of content header.
1 parent 41abb98 commit b678d0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pyodata/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def _fetch_metadata(connection, url, logger):
2222
f'Metadata request failed, status code: {resp.status_code}, body:\n{resp.content}', resp)
2323

2424
mime_type = resp.headers['content-type']
25-
if not any((typ in ['application/xml', 'text/xml'] for typ in mime_type.split(';'))):
25+
if not any((typ in ['application/xml', 'application/atom+xml', 'text/xml'] for typ in mime_type.split(';'))):
2626
raise HttpError(
2727
f'Metadata request did not return XML, MIME type: {mime_type}, body:\n{resp.content}',
2828
resp)

0 commit comments

Comments
 (0)