Update to Guzzle 6.5 with backported guzzle/guzzle#2741
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 30 Sep 2020 10:27:30 +0000 (12:27 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 30 Sep 2020 10:27:30 +0000 (12:27 +0200)
wcfsetup/install/files/lib/system/api/composer.json
wcfsetup/install/files/lib/system/api/composer.lock
wcfsetup/install/files/lib/system/api/composer/installed.json
wcfsetup/install/files/lib/system/api/guzzlehttp/guzzle/src/Handler/CurlFactory.php

index 122cfe8e17362a6a48f112f69cc00e59cb922000..0ea471ca44b64a5d6f5d14bbf5824a118fe6b58a 100644 (file)
         "true/punycode": "~2.0",
         "pear/net_idna2": "^0.2.0",
         "scssphp/scssphp": "^1.1",
-        "guzzlehttp/guzzle": "^6.5"
-    }
+        "guzzlehttp/guzzle": "dev-6.5-windows"
+    },
+    "repositories": [
+        {
+            "type": "vcs",
+            "url": "https://github.com/WoltLab/guzzle",
+            "no-api": true
+        }
+    ]
 }
index 1390129dfa09e4246ef0069603c55cb444a51420..399dc02aecb74c9a3d7a11b64a7a56040ef50ffe 100644 (file)
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "637eee25ca708b927eb477c205f58476",
+    "content-hash": "84035248a681a0748790233bd2a4189f",
     "packages": [
         {
             "name": "chrisjean/php-ico",
         },
         {
             "name": "guzzlehttp/guzzle",
-            "version": "6.5.5",
+            "version": "dev-6.5-windows",
             "source": {
                 "type": "git",
-                "url": "https://github.com/guzzle/guzzle.git",
-                "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e"
+                "url": "https://github.com/WoltLab/guzzle",
+                "reference": "2d4592a12d3d6757f9969122730e69d6b7c82af0"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e",
-                "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e",
+                "url": "https://api.github.com/repos/WoltLab/guzzle/zipball/2d4592a12d3d6757f9969122730e69d6b7c82af0",
+                "reference": "2d4592a12d3d6757f9969122730e69d6b7c82af0",
                 "shasum": ""
             },
             "require": {
                     "src/functions_include.php"
                 ]
             },
-            "notification-url": "https://packagist.org/downloads/",
+            "autoload-dev": {
+                "psr-4": {
+                    "GuzzleHttp\\Tests\\": "tests/"
+                }
+            },
             "license": [
                 "MIT"
             ],
             "description": "Guzzle is a PHP HTTP client library",
             "homepage": "http://guzzlephp.org/",
             "keywords": [
+                "HTTP client",
                 "client",
                 "curl",
                 "framework",
                 "http",
-                "http client",
                 "rest",
                 "web service"
             ],
-            "time": "2020-06-16T21:01:06+00:00"
+            "time": "2020-09-30T10:06:20+00:00"
         },
         {
             "name": "guzzlehttp/promises",
     "packages-dev": [],
     "aliases": [],
     "minimum-stability": "stable",
-    "stability-flags": [],
+    "stability-flags": {
+        "guzzlehttp/guzzle": 20
+    },
     "prefer-stable": false,
     "prefer-lowest": false,
     "platform": [],
index c80236c8d5cf4545e7adfd9e017626555eb741d8..0cc5f5690e2fcf74e936a87be54b8bc2d40028e7 100644 (file)
     },
     {
         "name": "guzzlehttp/guzzle",
-        "version": "6.5.5",
-        "version_normalized": "6.5.5.0",
+        "version": "dev-6.5-windows",
+        "version_normalized": "dev-6.5-windows",
         "source": {
             "type": "git",
-            "url": "https://github.com/guzzle/guzzle.git",
-            "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e"
+            "url": "https://github.com/WoltLab/guzzle",
+            "reference": "2d4592a12d3d6757f9969122730e69d6b7c82af0"
         },
         "dist": {
             "type": "zip",
-            "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e",
-            "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e",
+            "url": "https://api.github.com/repos/WoltLab/guzzle/zipball/2d4592a12d3d6757f9969122730e69d6b7c82af0",
+            "reference": "2d4592a12d3d6757f9969122730e69d6b7c82af0",
             "shasum": ""
         },
         "require": {
         "suggest": {
             "psr/log": "Required for using the Log middleware"
         },
-        "time": "2020-06-16T21:01:06+00:00",
+        "time": "2020-09-30T10:06:20+00:00",
         "type": "library",
         "extra": {
             "branch-alias": {
                 "src/functions_include.php"
             ]
         },
-        "notification-url": "https://packagist.org/downloads/",
+        "autoload-dev": {
+            "psr-4": {
+                "GuzzleHttp\\Tests\\": "tests/"
+            }
+        },
         "license": [
             "MIT"
         ],
         "description": "Guzzle is a PHP HTTP client library",
         "homepage": "http://guzzlephp.org/",
         "keywords": [
+            "HTTP client",
             "client",
             "curl",
             "framework",
             "http",
-            "http client",
             "rest",
             "web service"
         ]
index 4a28a96ebce6dbd41d31c2e24c1216052644344c..48d909383c008ad1954f873cb2875ced0ef45fae 100644 (file)
@@ -4,7 +4,6 @@ namespace GuzzleHttp\Handler;
 use GuzzleHttp\Exception\ConnectException;
 use GuzzleHttp\Exception\RequestException;
 use GuzzleHttp\Promise\FulfilledPromise;
-use GuzzleHttp\Psr7;
 use GuzzleHttp\Psr7\LazyOpenStream;
 use GuzzleHttp\TransferStats;
 use Psr\Http\Message\RequestInterface;
@@ -376,7 +375,12 @@ class CurlFactory implements CurlFactoryInterface
             }
         }
 
-        if (isset($options['sink'])) {
+        // Do not connect a sink for HEAD requests.
+        if ($easy->request->getMethod() !== 'HEAD') {
+            if (!isset($options['sink'])) {
+                // Use a default temp stream if no sink was set.
+                $options['sink'] = \fopen('php://temp', 'w+');
+            }
             $sink = $options['sink'];
             if (!is_string($sink)) {
                 $sink = \GuzzleHttp\Psr7\stream_for($sink);
@@ -394,11 +398,8 @@ class CurlFactory implements CurlFactoryInterface
             $conf[CURLOPT_WRITEFUNCTION] = function ($ch, $write) use ($sink) {
                 return $sink->write($write);
             };
-        } else {
-            // Use a default temp stream if no sink was set.
-            $conf[CURLOPT_FILE] = fopen('php://temp', 'w+');
-            $easy->sink = Psr7\stream_for($conf[CURLOPT_FILE]);
         }
+
         $timeoutRequiresNoSignal = false;
         if (isset($options['timeout'])) {
             $timeoutRequiresNoSignal |= $options['timeout'] < 1;