mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-25 08:41:00 +00:00
Do not canonicalise non json content in the search endpoint (#654)
This commit is contained in:
parent
cc9e397f60
commit
2f546dfa74
1 changed files with 3 additions and 0 deletions
|
@ -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 a new issue