Skip to content

Commit b9809f6

Browse files
add Accept HTTP headers to MDQ queries (#1865)
Co-authored-by: Guillaume Rousse <guillaume.rousse@renater.fr>
1 parent 450df2f commit b9809f6

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • src/SimpleSAML/Metadata/Sources

src/SimpleSAML/Metadata/Sources/MDQ.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,13 @@ public function getMetaData(string $entityId, string $set): ?array
297297

298298
Logger::debug(sprintf('%s: downloading metadata for "%s" from [%s]', __CLASS__, $entityId, $mdq_url));
299299
$httpUtils = new Utils\HTTP();
300+
$context = [
301+
'http' => [
302+
'header' => 'Accept: application/samlmetadata+xml'
303+
]
304+
];
300305
try {
301-
$xmldata = $httpUtils->fetch($mdq_url);
306+
$xmldata = $httpUtils->fetch($mdq_url, $context);
302307
} catch (Exception $e) {
303308
// Avoid propagating the exception, make sure we can handle the error later
304309
$xmldata = false;

0 commit comments

Comments
 (0)