Skip to content

Commit

Permalink
Graph.php: Graph::load uses correct Accept-headers from now on
Browse files Browse the repository at this point in the history
  • Loading branch information
k00ni authored May 10, 2024
1 parent f245c71 commit fd7359c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/Graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,19 @@ public function load($uri = null, $format = null)
}
}
} else {
$acceptHeader = Format::formatAcceptHeader([
'application/ld+json' => 1.0,
'application/rdf+xml' => 0.9,
'text/turtle' => 0.8,
'application/n-quads' => 0.7,
'application/n-triples' => 0.7,
]);

// Send a list of all the formats we can parse
if ($client instanceof Client) {
$client->setHeaders('Accept', Format::getHttpAcceptHeader());
$client->setHeaders('Accept', $acceptHeader);
} else {
$client->setHeaders(['Accept' => Format::getHttpAcceptHeader()]);
$client->setHeaders(['Accept' => $acceptHeader]);
}
}

Expand Down

0 comments on commit fd7359c

Please sign in to comment.