Do not canonicalise non json content in the search endpoint (#654)
This commit is contained in:
parent
cc9e397f60
commit
2f546dfa74
|
@ -81,6 +81,9 @@ class SearchService:
|
||||||
return None
|
return None
|
||||||
if response.status_code >= 400:
|
if response.status_code >= 400:
|
||||||
return None
|
return None
|
||||||
|
content_type = response.headers.get("Content-Type", "").lower()
|
||||||
|
if content_type not in ["application/json", "application/ld+json"]:
|
||||||
|
return None
|
||||||
document = canonicalise(response.json(), include_security=True)
|
document = canonicalise(response.json(), include_security=True)
|
||||||
type = document.get("type", "unknown").lower()
|
type = document.get("type", "unknown").lower()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue