1
0
Fork 0

Fixup HTTP headers for httpClient requests

This commit is contained in:
Philipp Holzer 2021-08-24 14:17:42 +02:00
commit 2356221aba
No known key found for this signature in database
GPG key ID: 9A28B7D4FF5667BD
12 changed files with 36 additions and 33 deletions

View file

@ -976,7 +976,7 @@ class DFRN
$content_type = ($public_batch ? "application/magic-envelope+xml" : "application/json");
$postResult = DI::httpRequest()->post($dest_url, $envelope, ["Content-Type: " . $content_type]);
$postResult = DI::httpRequest()->post($dest_url, $envelope, ['Content-Type' => $content_type]);
$xml = $postResult->getBody();
$curl_stat = $postResult->getReturnCode();

View file

@ -3022,7 +3022,7 @@ class Diaspora
if (!intval(DI::config()->get("system", "diaspora_test"))) {
$content_type = (($public_batch) ? "application/magic-envelope+xml" : "application/json");
$postResult = DI::httpRequest()->post($dest_url . "/", $envelope, ["Content-Type: " . $content_type]);
$postResult = DI::httpRequest()->post($dest_url . "/", $envelope, ['Content-Type' => $content_type]);
$return_code = $postResult->getReturnCode();
} else {
Logger::log("test_mode");

View file

@ -727,7 +727,7 @@ class OStatus
self::$conv_list[$conversation] = true;
$curlResult = DI::httpRequest()->get($conversation, ['accept_content' => 'application/atom+xml, text/html']);
$curlResult = DI::httpRequest()->get($conversation, ['accept_content' => ['application/atom+xml', 'text/html']]);
if (!$curlResult->isSuccess() || empty($curlResult->getBody())) {
return;
@ -921,7 +921,7 @@ class OStatus
}
$stored = false;
$curlResult = DI::httpRequest()->get($related, ['accept_content' => 'application/atom+xml, text/html']);
$curlResult = DI::httpRequest()->get($related, ['accept_content' => ['application/atom+xml', 'text/html']]);
if (!$curlResult->isSuccess() || empty($curlResult->getBody())) {
return;

View file

@ -156,8 +156,8 @@ class Salmon
// slap them
$postResult = DI::httpRequest()->post($url, $salmon, [
'Content-type: application/magic-envelope+xml',
'Content-length: ' . strlen($salmon)
'Content-type' => 'application/magic-envelope+xml',
'Content-length' => strlen($salmon),
]);
$return_code = $postResult->getReturnCode();
@ -181,8 +181,8 @@ class Salmon
// slap them
$postResult = DI::httpRequest()->post($url, $salmon, [
'Content-type: application/magic-envelope+xml',
'Content-length: ' . strlen($salmon)
'Content-type' => 'application/magic-envelope+xml',
'Content-length' => strlen($salmon),
]);
$return_code = $postResult->getReturnCode();
}
@ -204,8 +204,8 @@ class Salmon
// slap them
$postResult = DI::httpRequest()->post($url, $salmon, [
'Content-type: application/magic-envelope+xml',
'Content-length: ' . strlen($salmon)]);
'Content-type' => 'application/magic-envelope+xml',
'Content-length' => strlen($salmon)]);
$return_code = $postResult->getReturnCode();
}