Skip to content

Commit ad8504b

Browse files
authored
Fix issue when http headers are already present
1 parent b5ab21e commit ad8504b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/JsonSchema/Uri/Retrievers/FileGetContents.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ class FileGetContents extends AbstractRetriever
2929
*/
3030
public function retrieve($uri)
3131
{
32+
if (function_exists('http_clear_last_response_headers')) {
33+
http_clear_last_response_headers();
34+
}
35+
3236
$errorMessage = null;
3337
set_error_handler(function ($errno, $errstr) use (&$errorMessage) {
3438
$errorMessage = $errstr;

0 commit comments

Comments
 (0)