diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-07-12 13:55:15 +0200 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-07-12 13:55:15 +0200 |
commit | cc38526f97486a72752bd61d64f17d59c3c02325 (patch) | |
tree | d5278567744159fa389db622a9197c033cecf817 | |
parent | e50898a9a67eb12b3b2150a6f1028d213a4dfeab (diff) |
Fix networking issues
Otherwise webfinger requests are not executed correctly
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
-rw-r--r-- | lib/Controller/LocalController.php | 2 | ||||
-rw-r--r-- | lib/Tools/Traits/TNCRequest.php | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/Controller/LocalController.php b/lib/Controller/LocalController.php index 12098d37..854c1024 100644 --- a/lib/Controller/LocalController.php +++ b/lib/Controller/LocalController.php @@ -112,7 +112,7 @@ class LocalController extends Controller { * @NoAdminRequired */ public function uploadAttachement(): DataResponse { - + } diff --git a/lib/Tools/Traits/TNCRequest.php b/lib/Tools/Traits/TNCRequest.php index 68f28a9c..b59a540e 100644 --- a/lib/Tools/Traits/TNCRequest.php +++ b/lib/Tools/Traits/TNCRequest.php @@ -184,7 +184,7 @@ trait TNCRequest { if ($request->getType() !== Request::TYPE_GET) { $curl = curl_init($url); } else { - $curl = curl_init($url . '?' . $request->getUrlData()); + $curl = curl_init($url . $request->getQueryString()); } return $curl; @@ -249,8 +249,12 @@ trait TNCRequest { */ private function initRequestHeaders($curl, Request $request) { $headers = $request->getHeaders(); + $headersCurl = []; + foreach ($headers as $name => $value) { + $headersCurl[] = $name . ': ' . $value; + } - curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); + curl_setopt($curl, CURLOPT_HTTPHEADER, $headersCurl); } |