diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-07-12 14:05:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-12 14:05:10 +0200 |
commit | 2e26de84e47929d2a5b1ac7c1508e0f52b632e92 (patch) | |
tree | bcdf144284c24d1656f7b1d0039942ef1d39ecd6 | |
parent | 9c8333af78d2170576b8096e979014efe080c489 (diff) | |
parent | cc38526f97486a72752bd61d64f17d59c3c02325 (diff) |
Merge pull request #1445 from nextcloud/fix/networking
Fix networking issues
-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); } |