Skip to content

Commit 6f0657a

Browse files
committed
Fix to work with Symfony's http-client
1 parent d49a0c2 commit 6f0657a

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/MetaLoader.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -384,23 +384,23 @@ private function createContext(array $source): array
384384
$name = $config->getOptionalString('technicalcontact_name', null);
385385
$mail = $config->getOptionalString('technicalcontact_email', null);
386386

387-
$rawheader = "User-Agent: SimpleSAMLphp metarefresh, run by $name <$mail>\r\n";
387+
$headers = [
388+
'User-Agent' => 'SimpleSAMLphp metarefresh, run by $name <$mail>";
389+
];
388390
389391
if (isset($source['conditionalGET']) && $source['conditionalGET']) {
390392
if (array_key_exists($source['src'], $this->state)) {
391393
$sourceState = $this->state[$source['src']];
392394

393395
if (isset($sourceState['last-modified'])) {
394-
$rawheader .= 'If-Modified-Since: ' . $sourceState['last-modified'] . "\r\n";
396+
$headers['If-Modified-Since'] = $sourceState['last-modified'];
395397
}
396398

397399
if (isset($sourceState['etag'])) {
398-
$rawheader .= 'If-None-Match: ' . $sourceState['etag'] . "\r\n";
400+
$headers['If-None-Match'] = $sourceState['etag'];
399401
}
400402
}
401403
}
402-
403-
return ['http' => ['header' => $rawheader]];
404404
}
405405

406406

0 commit comments

Comments
 (0)