Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/SimpleSAML/Utils/HTTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -534,9 +534,14 @@ public function fetch(string $url, array $context = [], bool $getHeaders = false

// data and headers
if ($getHeaders) {
if (!empty($http_response_header)) {
if (PHP_VERSION_ID > 80500) {
$http_response_headers = http_get_last_response_headers();
} else {
$http_response_headers = $http_response_header ?? [];
}
if (!empty($http_response_headers)) {
$headers = [];
foreach ($http_response_header as $h) {
foreach ($http_response_headers as $h) {
if (preg_match('@^HTTP/1\.[01]\s+\d{3}\s+@', $h)) {
$headers = []; // reset
$headers[0] = $h;
Expand Down
Loading