From 1e1311b1f5922d83dff9540cb2e862f986985fd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 18 Nov 2020 14:28:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Client/Curl.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/HttpServer/Client/Curl.php b/HttpServer/Client/Curl.php index e00af93b..9f38411b 100644 --- a/HttpServer/Client/Curl.php +++ b/HttpServer/Client/Curl.php @@ -63,6 +63,13 @@ class Curl extends ClientAbstracts public function upload($path, $params = []) { [$host, $isHttps, $path] = $this->matchHost($path); + + if ($isHttps) { + $host = 'https://' . $host; + } else { + $host = 'http://' . $host; + } + $resource = $this->do(curl_init($host . $path), $host . ':443' . $path, self::POST); curl_setopt($resource, CURLOPT_SAFE_UPLOAD, true);