Do not canonicalise non json content in the search endpoint (#654)

pull/656/head
Humberto Rocha 2023-11-15 17:00:56 -05:00 zatwierdzone przez GitHub
rodzic cc9e397f60
commit 2f546dfa74
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -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()