Skip to content

Commit

Permalink
fix: Parse headers in reverse order to match with last header avoidin…
Browse files Browse the repository at this point in the history
…g matches on HTTP 301 redirect headers which are listed first
  • Loading branch information
DannyvdSluijs committed May 26, 2024
1 parent e6ea522 commit 4479f6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/JsonSchema/Uri/Retrievers/FileGetContents.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function retrieve($uri)
*/
private function fetchContentType(array $headers)
{
foreach ($headers as $header) {
foreach (array_reverse($headers) as $header) {
if ($this->contentType = self::getContentTypeMatchInHeader($header)) {
return true;
}
Expand Down

0 comments on commit 4479f6e

Please sign in to comment.