Skip to content

Commit

Permalink
#245 Auto detect Turtle @ octet-stream data
Browse files Browse the repository at this point in the history
  • Loading branch information
anatoly-scherbakov committed Dec 27, 2024
1 parent 9c8c74d commit a5afacd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions yaml_ld/document_loaders/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,12 @@ def __call__( # noqa: WPS210
if content_type is None and response.text.startswith('<rdf:RDF'):
content_type = 'application/rdf+xml'

if (
content_type == 'application/octet-stream'
and response.text.startswith('@prefix')
):
content_type = 'text/turtle'

if content_type is None:
raise ContentTypeNotDetermined(
source=source,
Expand Down

0 comments on commit a5afacd

Please sign in to comment.