mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-21 23:01: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
|
||||
if response.status_code >= 400:
|
||||
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)
|
||||
type = document.get("type", "unknown").lower()
|
||||
|
||||
|
|
Loading…
Reference in a new issue