Introduce "accept_header" as specific argument to the http client

This commit is contained in:
Philipp 2022-04-02 21:16:22 +02:00
parent 73c3b21665
commit e299fc67c8
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
35 changed files with 150 additions and 150 deletions

View file

@ -73,7 +73,7 @@ class Salmon
$ret[$x] = substr($ret[$x], 5);
}
} elseif (Strings::normaliseLink($ret[$x]) == 'http://') {
$ret[$x] = DI::httpClient()->fetch($ret[$x], 0, HttpClientAccept::MAGIC_KEY);
$ret[$x] = DI::httpClient()->fetch($ret[$x], HttpClientAccept::MAGIC_KEY);
Logger::debug('Fetched public key', ['url' => $ret[$x]]);
}
}
@ -157,7 +157,7 @@ class Salmon
$salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
// slap them
$postResult = DI::httpClient()->post($url, $salmon, [
$postResult = DI::httpClient()->post($url, $salmon, HttpClientAccept::DEFAULT, [
'Content-type' => 'application/magic-envelope+xml',
'Content-length' => strlen($salmon),
]);
@ -182,7 +182,7 @@ class Salmon
$salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
// slap them
$postResult = DI::httpClient()->post($url, $salmon, [
$postResult = DI::httpClient()->post($url, $salmon, HttpClientAccept::DEFAULT, [
'Content-type' => 'application/magic-envelope+xml',
'Content-length' => strlen($salmon),
]);
@ -205,7 +205,7 @@ class Salmon
$salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
// slap them
$postResult = DI::httpClient()->post($url, $salmon, [
$postResult = DI::httpClient()->post($url, $salmon, HttpClientAccept::DEFAULT, [
'Content-type' => 'application/magic-envelope+xml',
'Content-length' => strlen($salmon)]);
$return_code = $postResult->getReturnCode();