Skip to content

Commit 4479f6e

Browse files
committed
fix: Parse headers in reverse order to match with last header avoiding matches on HTTP 301 redirect headers which are listed first
1 parent e6ea522 commit 4479f6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/JsonSchema/Uri/Retrievers/FileGetContents.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function retrieve($uri)
6868
*/
6969
private function fetchContentType(array $headers)
7070
{
71-
foreach ($headers as $header) {
71+
foreach (array_reverse($headers) as $header) {
7272
if ($this->contentType = self::getContentTypeMatchInHeader($header)) {
7373
return true;
7474
}

0 commit comments

Comments
 (0)