From 05ca07b2981cbe64e58825aeb9362d88c8fc5aca Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Sun, 3 Apr 2022 13:22:38 +0200 Subject: [PATCH] Bump guzzlehttp/psr7 from 1.8.3 to 1.8.5 Signed-off-by: Carl Schwan --- .github/workflows/composer.yml | 2 + composer.json | 5 +- composer.lock | 14 +- composer/ClassLoader.php | 2 +- composer/InstalledVersions.php | 2 + composer/autoload_classmap.php | 2 +- composer/autoload_files.php | 8 +- composer/autoload_namespaces.php | 2 +- composer/autoload_psr4.php | 2 +- composer/autoload_real.php | 30 ++-- composer/autoload_static.php | 6 +- composer/include_paths.php | 2 +- composer/installed.json | 14 +- composer/installed.php | 10 +- .../src/PackageVersions/Versions.php | 139 +++--------------- guzzlehttp/psr7/CHANGELOG.md | 18 +++ guzzlehttp/psr7/LICENSE | 9 +- guzzlehttp/psr7/README.md | 15 ++ guzzlehttp/psr7/composer.json | 29 +++- guzzlehttp/psr7/src/CachingStream.php | 8 +- guzzlehttp/psr7/src/MessageTrait.php | 66 ++++++++- 21 files changed, 208 insertions(+), 177 deletions(-) diff --git a/.github/workflows/composer.yml b/.github/workflows/composer.yml index c98c1d833..ab2ab807e 100644 --- a/.github/workflows/composer.yml +++ b/.github/workflows/composer.yml @@ -26,6 +26,8 @@ jobs: run: rm -rf ./*/ - name: Download dependencies run: composer install --no-dev + - name: Remove tests and other untracked files + run: git clean -X -d -f - name: Dump Autoload run: composer dump-autoload - name: Check vendor changes diff --git a/composer.json b/composer.json index c15edd887..4cf43a19e 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,10 @@ "platform": { "php": "7.3.0" }, - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "cweagans/composer-patches": true + } }, "require": { "php": "^7.3|^8.0", diff --git a/composer.lock b/composer.lock index 48bf95bb3..0f1c1065d 100644 --- a/composer.lock +++ b/composer.lock @@ -1375,16 +1375,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.8.2", + "version": "1.8.5", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "dc960a912984efb74d0a90222870c72c87f10c91" + "reference": "337e3ad8e5716c15f9657bd214d16cc5e69df268" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91", - "reference": "dc960a912984efb74d0a90222870c72c87f10c91", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/337e3ad8e5716c15f9657bd214d16cc5e69df268", + "reference": "337e3ad8e5716c15f9657bd214d16cc5e69df268", "shasum": "" }, "require": { @@ -1444,9 +1444,9 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.8.2" + "source": "https://github.com/guzzle/psr7/tree/1.8.5" }, - "time": "2021-04-26T09:17:50+00:00" + "time": "2022-03-20T21:51:18+00:00" }, { "name": "guzzlehttp/uri-template", @@ -5962,5 +5962,5 @@ "platform-overrides": { "php": "7.3.0" }, - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.2.0" } diff --git a/composer/ClassLoader.php b/composer/ClassLoader.php index 0cd6055d1..afef3fa2a 100644 --- a/composer/ClassLoader.php +++ b/composer/ClassLoader.php @@ -149,7 +149,7 @@ public function getFallbackDirsPsr4() /** * @return string[] Array of classname => path - * @psalm-var array + * @psalm-return array */ public function getClassMap() { diff --git a/composer/InstalledVersions.php b/composer/InstalledVersions.php index d50e0c9fc..41bc143c1 100644 --- a/composer/InstalledVersions.php +++ b/composer/InstalledVersions.php @@ -21,6 +21,8 @@ * See also https://getcomposer.org/doc/07-runtime.md#installed-versions * * To require its presence, you can require `composer-runtime-api ^2.0` + * + * @final */ class InstalledVersions { diff --git a/composer/autoload_classmap.php b/composer/autoload_classmap.php index 636ba6b5c..b8dffd0ce 100644 --- a/composer/autoload_classmap.php +++ b/composer/autoload_classmap.php @@ -2,7 +2,7 @@ // autoload_classmap.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = $vendorDir; return array( diff --git a/composer/autoload_files.php b/composer/autoload_files.php index d6626ae3b..38213a0f5 100644 --- a/composer/autoload_files.php +++ b/composer/autoload_files.php @@ -2,17 +2,16 @@ // autoload_files.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = $vendorDir; return array( - 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', '383eaff206634a77a1be54e64e6459c7' => $vendorDir . '/sabre/uri/lib/functions.php', + 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', - '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', + '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', 'a4ecaeafb8cfb009ad0e052c90355e98' => $vendorDir . '/beberlei/assert/lib/Assert/functions.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', '2b9d0f43f9552984cfa82fee95491826' => $vendorDir . '/sabre/event/lib/coroutine.php', @@ -25,6 +24,7 @@ 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', 'ebdb698ed4152ae445614b69b5e4bb6a' => $vendorDir . '/sabre/http/lib/functions.php', '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', + '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', 'b067bc7112e384b61c701452d53a14a8' => $vendorDir . '/mtdowling/jmespath.php/src/JmesPath.php', 'e39a8b23c42d4e1452234d762b03835a' => $vendorDir . '/ramsey/uuid/src/functions.php', 'def43f6c87e4f8dfd0c9e1b1bab14fe8' => $vendorDir . '/symfony/polyfill-iconv/bootstrap.php', diff --git a/composer/autoload_namespaces.php b/composer/autoload_namespaces.php index f05134514..225f7eb6a 100644 --- a/composer/autoload_namespaces.php +++ b/composer/autoload_namespaces.php @@ -2,7 +2,7 @@ // autoload_namespaces.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = $vendorDir; return array( diff --git a/composer/autoload_psr4.php b/composer/autoload_psr4.php index 30c5203bb..518c268b4 100644 --- a/composer/autoload_psr4.php +++ b/composer/autoload_psr4.php @@ -2,7 +2,7 @@ // autoload_psr4.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = $vendorDir; return array( diff --git a/composer/autoload_real.php b/composer/autoload_real.php index 51e19b2df..5ed008124 100644 --- a/composer/autoload_real.php +++ b/composer/autoload_real.php @@ -25,33 +25,20 @@ public static function getLoader() require __DIR__ . '/platform_check.php'; spl_autoload_register(array('ComposerAutoloaderInit2f23f73bc0cc116b4b1eee1521aa8652', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInit2f23f73bc0cc116b4b1eee1521aa8652', 'loadClassLoader')); $includePaths = require __DIR__ . '/include_paths.php'; $includePaths[] = get_include_path(); set_include_path(implode(PATH_SEPARATOR, $includePaths)); - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require __DIR__ . '/autoload_static.php'; - - call_user_func(\Composer\Autoload\ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652::getInitializer($loader)); - } else { - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - } + require __DIR__ . '/autoload_static.php'; + \Composer\Autoload\ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652::getInitializer($loader)(); $loader->setClassMapAuthoritative(true); $loader->register(true); - if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652::$files; - } else { - $includeFiles = require __DIR__ . '/autoload_files.php'; - } + $includeFiles = \Composer\Autoload\ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652::$files; foreach ($includeFiles as $fileIdentifier => $file) { composerRequire2f23f73bc0cc116b4b1eee1521aa8652($fileIdentifier, $file); } @@ -60,11 +47,16 @@ public static function getLoader() } } +/** + * @param string $fileIdentifier + * @param string $file + * @return void + */ function composerRequire2f23f73bc0cc116b4b1eee1521aa8652($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - require $file; - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; } } diff --git a/composer/autoload_static.php b/composer/autoload_static.php index 8ab952332..3e7ab4f01 100644 --- a/composer/autoload_static.php +++ b/composer/autoload_static.php @@ -7,13 +7,12 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652 { public static $files = array ( - 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', '383eaff206634a77a1be54e64e6459c7' => __DIR__ . '/..' . '/sabre/uri/lib/functions.php', + 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', - '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', + '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', 'a4ecaeafb8cfb009ad0e052c90355e98' => __DIR__ . '/..' . '/beberlei/assert/lib/Assert/functions.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', '2b9d0f43f9552984cfa82fee95491826' => __DIR__ . '/..' . '/sabre/event/lib/coroutine.php', @@ -26,6 +25,7 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', 'ebdb698ed4152ae445614b69b5e4bb6a' => __DIR__ . '/..' . '/sabre/http/lib/functions.php', '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', + '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', 'b067bc7112e384b61c701452d53a14a8' => __DIR__ . '/..' . '/mtdowling/jmespath.php/src/JmesPath.php', 'e39a8b23c42d4e1452234d762b03835a' => __DIR__ . '/..' . '/ramsey/uuid/src/functions.php', 'def43f6c87e4f8dfd0c9e1b1bab14fe8' => __DIR__ . '/..' . '/symfony/polyfill-iconv/bootstrap.php', diff --git a/composer/include_paths.php b/composer/include_paths.php index e7d0ea320..8c87e2c20 100644 --- a/composer/include_paths.php +++ b/composer/include_paths.php @@ -2,7 +2,7 @@ // include_paths.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = $vendorDir; return array( diff --git a/composer/installed.json b/composer/installed.json index 8c3ab6164..7c23ae667 100644 --- a/composer/installed.json +++ b/composer/installed.json @@ -1429,17 +1429,17 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.8.2", - "version_normalized": "1.8.2.0", + "version": "1.8.5", + "version_normalized": "1.8.5.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "dc960a912984efb74d0a90222870c72c87f10c91" + "reference": "337e3ad8e5716c15f9657bd214d16cc5e69df268" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91", - "reference": "dc960a912984efb74d0a90222870c72c87f10c91", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/337e3ad8e5716c15f9657bd214d16cc5e69df268", + "reference": "337e3ad8e5716c15f9657bd214d16cc5e69df268", "shasum": "" }, "require": { @@ -1457,7 +1457,7 @@ "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, - "time": "2021-04-26T09:17:50+00:00", + "time": "2022-03-20T21:51:18+00:00", "type": "library", "extra": { "branch-alias": { @@ -1501,7 +1501,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.8.2" + "source": "https://github.com/guzzle/psr7/tree/1.8.5" }, "install-path": "../guzzlehttp/psr7" }, diff --git a/composer/installed.php b/composer/installed.php index eea2f524b..717cd32bf 100644 --- a/composer/installed.php +++ b/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'library', 'install_path' => __DIR__ . '/../', 'aliases' => array(), - 'reference' => '6dbc988f738b92a5da1da47e5bad328eebb04ee5', + 'reference' => 'fd3e5128c875571ce89742bf45c9b460fa2a8351', 'name' => 'nextcloud/3rdparty', 'dev' => false, ), @@ -191,12 +191,12 @@ 'dev_requirement' => false, ), 'guzzlehttp/psr7' => array( - 'pretty_version' => '1.8.2', - 'version' => '1.8.2.0', + 'pretty_version' => '1.8.5', + 'version' => '1.8.5.0', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/psr7', 'aliases' => array(), - 'reference' => 'dc960a912984efb74d0a90222870c72c87f10c91', + 'reference' => '337e3ad8e5716c15f9657bd214d16cc5e69df268', 'dev_requirement' => false, ), 'guzzlehttp/uri-template' => array( @@ -286,7 +286,7 @@ 'type' => 'library', 'install_path' => __DIR__ . '/../', 'aliases' => array(), - 'reference' => '6dbc988f738b92a5da1da47e5bad328eebb04ee5', + 'reference' => 'fd3e5128c875571ce89742bf45c9b460fa2a8351', 'dev_requirement' => false, ), 'nextcloud/lognormalizer' => array( diff --git a/composer/package-versions-deprecated/src/PackageVersions/Versions.php b/composer/package-versions-deprecated/src/PackageVersions/Versions.php index 398306933..9cbf18772 100644 --- a/composer/package-versions-deprecated/src/PackageVersions/Versions.php +++ b/composer/package-versions-deprecated/src/PackageVersions/Versions.php @@ -6,16 +6,17 @@ use Composer\InstalledVersions; use OutOfBoundsException; +use UnexpectedValueException; class_exists(InstalledVersions::class); /** - * This class is generated by composer/package-versions-deprecated, specifically by - * @see \PackageVersions\Installer + * This is a stub class: it is in place only for scenarios where PackageVersions + * is installed with a `--no-scripts` flag, in which scenarios the Versions class + * is not being replaced. * - * This file is overwritten at every run of `composer install` or `composer update`. - * - * @deprecated in favor of the Composer\InstalledVersions class provided by Composer 2. Require composer-runtime-api:^2 to ensure it is present. + * If you are reading this docBlock inside your `vendor/` dir, then this means + * that PackageVersions didn't correctly install, and is in "fallback" mode. */ final class Versions { @@ -23,104 +24,10 @@ final class Versions * @deprecated please use {@see self::rootPackageName()} instead. * This constant will be removed in version 2.0.0. */ - const ROOT_PACKAGE_NAME = 'nextcloud/3rdparty'; + const ROOT_PACKAGE_NAME = 'unknown/root-package@UNKNOWN'; - /** - * Array of all available composer packages. - * Dont read this array from your calling code, but use the \PackageVersions\Versions::getVersion() method instead. - * - * @var array - * @internal - */ - const VERSIONS = array ( - 'aws/aws-sdk-php' => '3.184.6@0b7187c96ced465d400ad9427157e05ddee68edc', - 'bantu/ini-get-wrapper' => 'v1.0.1@4770c7feab370c62e23db4f31c112b7c6d90aee2', - 'beberlei/assert' => 'v3.3.1@5e721d7e937ca3ba2cdec1e1adf195f9e5188372', - 'brick/math' => '0.9.2@dff976c2f3487d42c1db75a3b180e2b9f0e72ce0', - 'christophwurst/id3parser' => 'v0.1.2@d7f5e9e7db69a24e3111a2033cbdf640f9456f2f', - 'composer/package-versions-deprecated' => '1.11.99.4@b174585d1fe49ceed21928a945138948cb394600', - 'cweagans/composer-patches' => '1.7.1@9888dcc74993c030b75f3dd548bb5e20cdbd740c', - 'deepdiver/zipstreamer' => '2.0.0@b8c59647ff34fb97e8937aefb2a65de2bc4b4755', - 'deepdiver1975/tarstreamer' => '2.0.0@ad48505d1ab54a8e94e6b1cc5297bbed72e956de', - 'doctrine/cache' => '2.1.1@331b4d5dbaeab3827976273e9356b3b453c300ce', - 'doctrine/dbal' => '3.1.4@821b4f01a36ce63ed36c090ea74767b72db367e9', - 'doctrine/deprecations' => 'v0.5.3@9504165960a1f83cc1480e2be1dd0a0478561314', - 'doctrine/event-manager' => '1.1.1@41370af6a30faa9dc0368c4a6814d596e81aba7f', - 'doctrine/lexer' => '1.2.1@e864bbf5904cb8f5bb334f99209b48018522f042', - 'egulias/email-validator' => '3.1.1@c81f18a3efb941d8c4d2e025f6183b5c6d697307', - 'fgrosse/phpasn1' => 'v2.3.0@20299033c35f4300eb656e7e8e88cf52d1d6694e', - 'giggsey/libphonenumber-for-php' => '8.12.25@7d397cbd2e01e78cf79ff347e40a403dbc4c22fa', - 'giggsey/locale' => '1.9@b07f1eace8072ccc61445ad8fbd493ff9d783043', - 'guzzlehttp/guzzle' => '7.3.0@7008573787b430c1c1f650e3722d9bba59967628', - 'guzzlehttp/promises' => '1.4.1@8e7d04f1f6450fef59366c399cfad4b9383aa30d', - 'guzzlehttp/psr7' => '1.8.2@dc960a912984efb74d0a90222870c72c87f10c91', - 'guzzlehttp/uri-template' => 'v0.2.0@db46525d6d8fee71033b73cc07160f3e5271a8ce', - 'icewind/searchdav' => 'v2.0.0@c69806d900c2c9a5954bfabc80178d6eb0d63df4', - 'icewind/streams' => 'v0.7.5@0c6aae16ebdadb257f0bd089c1e1e4cf5e20ddc2', - 'justinrainbow/json-schema' => '5.2.10@2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b', - 'league/uri' => '6.4.0@09da64118eaf4c5d52f9923a1e6a5be1da52fd9a', - 'league/uri-interfaces' => '2.2.0@667f150e589d65d79c89ffe662e426704f84224f', - 'microsoft/azure-storage-blob' => '1.5.2@2475330963372d519387cb8135d6a9cfd42272da', - 'microsoft/azure-storage-common' => '1.5.1@e5738035891546075bd369954e8af121d65ebd6d', - 'mtdowling/jmespath.php' => '2.6.1@9b87907a81b87bc76d19a7fb2d61e61486ee9edb', - 'nextcloud/lognormalizer' => 'v1.0.0@87445d69225c247aaff64643b1fc83c6d6df741f', - 'nikic/php-parser' => 'v4.10.5@4432ba399e47c66624bc73c8c0f811e5c109576f', - 'opis/closure' => '3.6.2@06e2ebd25f2869e54a306dda991f7db58066f7f6', - 'pear/archive_tar' => '1.4.14@4d761c5334c790e45ef3245f0864b8955c562caa', - 'pear/console_getopt' => 'v1.4.3@a41f8d3e668987609178c7c4a9fe48fecac53fa0', - 'pear/pear-core-minimal' => 'v1.10.10@625a3c429d9b2c1546438679074cac1b089116a7', - 'pear/pear_exception' => 'v1.0.2@b14fbe2ddb0b9f94f5b24cf08783d599f776fff0', - 'php-ds/php-ds' => 'v1.3.0@b98396862fb8a13cbdbbaf4d18be28ee5c01ed3c', - 'php-http/guzzle7-adapter' => '1.0.0@fb075a71dbfa4847cf0c2938c4e5a9c478ef8b01', - 'php-http/httplug' => '2.2.0@191a0a1b41ed026b717421931f8d3bd2514ffbf9', - 'php-http/promise' => '1.1.0@4c4c1f9b7289a2ec57cde7f1e9762a5789506f88', - 'php-opencloud/openstack' => 'v3.1.0@7b0eeb63defe533fb802514af3c70855c45eaf1e', - 'phpseclib/phpseclib' => '2.0.32@f5c4c19880d45d0be3e7d24ae8ac434844a898cd', - 'pimple/pimple' => 'v3.4.0@86406047271859ffc13424a048541f4531f53601', - 'psr/container' => '1.1.1@8622567409010282b7aeebe4bb841fe98b58dcaf', - 'psr/event-dispatcher' => '1.0.0@dbefd12671e8a14ec7f180cab83036ed26714bb0', - 'psr/http-client' => '1.0.1@2dfb5f6c5eff0e91e20e913f8c5452ed95b86621', - 'psr/http-factory' => '1.0.1@12ac7fcd07e5b077433f5f2bee95b3a771bf61be', - 'psr/http-message' => '1.0.1@f6561bf28d520154e4b0ec72be95418abe6d9363', - 'psr/log' => '1.1.4@d49695b909c3b7628b6289db5479a1c204601f11', - 'punic/punic' => '1.6.5@7bc85ce1137cf52db4d2a6298256a4c4a24da99a', - 'ralouphie/getallheaders' => '3.0.3@120b605dfeb996808c31b6477290a714d356e822', - 'ramsey/collection' => '1.1.3@28a5c4ab2f5111db6a60b2b4ec84057e0f43b9c1', - 'ramsey/uuid' => '4.1.1@cd4032040a750077205918c86049aa0f43d22947', - 'sabre/dav' => '4.1.5@c1afdc77a95efea6ee40c03c45f57c3c0c80ec22', - 'sabre/event' => '5.1.2@c120bec57c17b6251a496efc82b732418b49d50a', - 'sabre/http' => '5.1.1@d0aafede6961df6195ce7a8dad49296b0aaee22e', - 'sabre/uri' => '2.2.1@f502edffafea8d746825bd5f0b923a60fd2715ff', - 'sabre/vobject' => '4.3.5@d8a0a9ae215a8acfb51afc29101c7344670b9c83', - 'sabre/xml' => '2.2.3@c3b959f821c19b36952ec4a595edd695c216bfc6', - 'scssphp/scssphp' => 'v1.4.1@ba86c963b94ec7ebd6e19d90cdab90d89667dbf7', - 'spomky-labs/base64url' => 'v2.0.4@7752ce931ec285da4ed1f4c5aa27e45e097be61d', - 'spomky-labs/cbor-php' => 'v2.0.1@9776578000be884cd7864eeb7c37a4ac92d8c995', - 'stecman/symfony-console-completion' => '0.11.0@a9502dab59405e275a9f264536c4e1cb61fc3518', - 'swiftmailer/swiftmailer' => 'v6.2.7@15f7faf8508e04471f666633addacf54c0ab5933', - 'symfony/console' => 'v4.4.30@a3f7189a0665ee33b50e9e228c46f50f5acbed22', - 'symfony/event-dispatcher' => 'v4.4.30@2fe81680070043c4c80e7cedceb797e34f377bac', - 'symfony/event-dispatcher-contracts' => 'v1.1.9@84e23fdcd2517bf37aecbd16967e83f0caee25a7', - 'symfony/polyfill-ctype' => 'v1.23.0@46cd95797e9df938fdd2b03693b5fca5e64b01ce', - 'symfony/polyfill-iconv' => 'v1.23.0@63b5bb7db83e5673936d6e3b8b3e022ff6474933', - 'symfony/polyfill-intl-grapheme' => 'v1.23.1@16880ba9c5ebe3642d1995ab866db29270b36535', - 'symfony/polyfill-intl-idn' => 'v1.23.0@65bd267525e82759e7d8c4e8ceea44f398838e65', - 'symfony/polyfill-intl-normalizer' => 'v1.23.0@8590a5f561694770bdcd3f9b5c69dde6945028e8', - 'symfony/polyfill-mbstring' => 'v1.23.1@9174a3d80210dca8daa7f31fec659150bbeabfc6', - 'symfony/polyfill-php72' => 'v1.23.0@9a142215a36a3888e30d0a9eeea9766764e96976', - 'symfony/polyfill-php73' => 'v1.23.0@fba8933c384d6476ab14fb7b8526e5287ca7e010', - 'symfony/polyfill-php80' => 'v1.23.1@1100343ed1a92e3a38f9ae122fc0eb21602547be', - 'symfony/process' => 'v4.4.30@13d3161ef63a8ec21eeccaaf9a4d7f784a87a97d', - 'symfony/routing' => 'v4.4.30@9ddf033927ad9f30ba2bfd167a7b342cafa13e8e', - 'symfony/service-contracts' => 'v2.4.0@f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb', - 'symfony/translation' => 'v4.4.30@db0ba1e85280d8ff11e38d53c70f8814d4d740f5', - 'symfony/translation-contracts' => 'v2.4.0@95c812666f3e91db75385749fe219c5e494c7f95', - 'thecodingmachine/safe' => 'v1.3.3@a8ab0876305a4cdaef31b2350fcb9811b5608dbc', - 'web-auth/cose-lib' => 'v3.3.9@ed172d2dc1a6b87b5c644c07c118cd30c1b3819b', - 'web-auth/metadata-service' => 'v3.3.9@8488d3a832a38cc81c670fce05de1e515c6e64b1', - 'web-auth/webauthn-lib' => 'v3.3.9@04b98ee3d39cb79dad68a7c15c297c085bf66bfe', - 'nextcloud/3rdparty' => 'dev-master@6dbc988f738b92a5da1da47e5bad328eebb04ee5', -); + /** @internal */ + const VERSIONS = []; private function __construct() { @@ -134,7 +41,7 @@ private function __construct() */ public static function rootPackageName() : string { - if (!self::composer2ApiUsable()) { + if (!class_exists(InstalledVersions::class, false) || !InstalledVersions::getRawData()) { return self::ROOT_PACKAGE_NAME; } @@ -142,28 +49,24 @@ public static function rootPackageName() : string } /** - * @throws OutOfBoundsException If a version cannot be located. - * - * @psalm-param key-of $packageName - * @psalm-pure - * - * @psalm-suppress ImpureMethodCall we know that {@see InstalledVersions} interaction does not - * cause any side effects here. + * @throws OutOfBoundsException if a version cannot be located. + * @throws UnexpectedValueException if the composer.lock file could not be located. */ public static function getVersion(string $packageName): string { - if (self::composer2ApiUsable()) { - return InstalledVersions::getPrettyVersion($packageName) - . '@' . InstalledVersions::getReference($packageName); + if (!self::composer2ApiUsable()) { + return FallbackVersions::getVersion($packageName); } - if (isset(self::VERSIONS[$packageName])) { - return self::VERSIONS[$packageName]; + /** @psalm-suppress DeprecatedConstant */ + if ($packageName === self::ROOT_PACKAGE_NAME) { + $rootPackage = InstalledVersions::getRootPackage(); + + return $rootPackage['pretty_version'] . '@' . $rootPackage['reference']; } - throw new OutOfBoundsException( - 'Required package "' . $packageName . '" is not installed: check your ./vendor/composer/installed.json and/or ./composer.lock files' - ); + return InstalledVersions::getPrettyVersion($packageName) + . '@' . InstalledVersions::getReference($packageName); } private static function composer2ApiUsable(): bool diff --git a/guzzlehttp/psr7/CHANGELOG.md b/guzzlehttp/psr7/CHANGELOG.md index 6a6b7bf98..f177f583f 100644 --- a/guzzlehttp/psr7/CHANGELOG.md +++ b/guzzlehttp/psr7/CHANGELOG.md @@ -9,6 +9,24 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## Unreleased +## 1.8.5 - 2022-03-20 + +### Fixed + +- Correct header value validation + +## 1.8.4 - 2022-03-20 + +### Fixed + +- Validate header values properly + +## 1.8.3 - 2021-10-05 + +### Fixed + +- Return `null` in caching stream size if remote size is `null` + ## 1.8.2 - 2021-04-26 ### Fixed diff --git a/guzzlehttp/psr7/LICENSE b/guzzlehttp/psr7/LICENSE index 581d95f92..51c7ec81c 100644 --- a/guzzlehttp/psr7/LICENSE +++ b/guzzlehttp/psr7/LICENSE @@ -1,4 +1,11 @@ -Copyright (c) 2015 Michael Dowling, https://github.com/mtdowling +The MIT License (MIT) + +Copyright (c) 2015 Michael Dowling +Copyright (c) 2015 Márk Sági-Kazár +Copyright (c) 2015 Graham Campbell +Copyright (c) 2016 Tobias Schultze +Copyright (c) 2016 George Mponos +Copyright (c) 2018 Tobias Nyholm Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/guzzlehttp/psr7/README.md b/guzzlehttp/psr7/README.md index acfabfdcb..464cae4f2 100644 --- a/guzzlehttp/psr7/README.md +++ b/guzzlehttp/psr7/README.md @@ -807,3 +807,18 @@ Whether two URIs can be considered equivalent. Both URIs are normalized automati `$normalizations` bitmask. The method also accepts relative URI references and returns true when they are equivalent. This of course assumes they will be resolved against the same base URI. If this is not the case, determination of equivalence or difference of relative references does not mean anything. + + +## Security + +If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/psr7/security/policy) for more information. + +## License + +Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information. + +## For Enterprise + +Available as part of the Tidelift Subscription + +The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-psr7?utm_source=packagist-guzzlehttp-psr7&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/guzzlehttp/psr7/composer.json b/guzzlehttp/psr7/composer.json index 58dcb07e4..7ecdc8ba3 100644 --- a/guzzlehttp/psr7/composer.json +++ b/guzzlehttp/psr7/composer.json @@ -1,17 +1,37 @@ { "name": "guzzlehttp/psr7", - "type": "library", "description": "PSR-7 message implementation that also provides common utility methods", "keywords": ["request", "response", "message", "stream", "http", "uri", "url", "psr-7"], "license": "MIT", "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, { "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", "homepage": "https://github.com/Tobion" } ], @@ -45,5 +65,12 @@ "branch-alias": { "dev-master": "1.7-dev" } + }, + "config": { + "preferred-install": "dist", + "sort-packages": true, + "allow-plugins": { + "bamarni/composer-bin-plugin": true + } } } diff --git a/guzzlehttp/psr7/src/CachingStream.php b/guzzlehttp/psr7/src/CachingStream.php index fe749e981..febade9f4 100644 --- a/guzzlehttp/psr7/src/CachingStream.php +++ b/guzzlehttp/psr7/src/CachingStream.php @@ -36,7 +36,13 @@ public function __construct( public function getSize() { - return max($this->stream->getSize(), $this->remoteStream->getSize()); + $remoteSize = $this->remoteStream->getSize(); + + if (null === $remoteSize) { + return null; + } + + return max($this->stream->getSize(), $remoteSize); } public function rewind() diff --git a/guzzlehttp/psr7/src/MessageTrait.php b/guzzlehttp/psr7/src/MessageTrait.php index 99203bb43..0ac8663da 100644 --- a/guzzlehttp/psr7/src/MessageTrait.php +++ b/guzzlehttp/psr7/src/MessageTrait.php @@ -157,17 +157,22 @@ private function setHeaders(array $headers) } } + /** + * @param mixed $value + * + * @return string[] + */ private function normalizeHeaderValue($value) { if (!is_array($value)) { - return $this->trimHeaderValues([$value]); + return $this->trimAndValidateHeaderValues([$value]); } if (count($value) === 0) { throw new \InvalidArgumentException('Header value can not be an empty array.'); } - return $this->trimHeaderValues($value); + return $this->trimAndValidateHeaderValues($value); } /** @@ -178,13 +183,13 @@ private function normalizeHeaderValue($value) * header-field = field-name ":" OWS field-value OWS * OWS = *( SP / HTAB ) * - * @param string[] $values Header values + * @param mixed[] $values Header values * * @return string[] Trimmed header values * * @see https://tools.ietf.org/html/rfc7230#section-3.2.4 */ - private function trimHeaderValues(array $values) + private function trimAndValidateHeaderValues(array $values) { return array_map(function ($value) { if (!is_scalar($value) && null !== $value) { @@ -194,10 +199,20 @@ private function trimHeaderValues(array $values) )); } - return trim((string) $value, " \t"); + $trimmed = trim((string) $value, " \t"); + $this->assertValue($trimmed); + + return $trimmed; }, array_values($values)); } + /** + * @see https://tools.ietf.org/html/rfc7230#section-3.2 + * + * @param mixed $header + * + * @return void + */ private function assertHeader($header) { if (!is_string($header)) { @@ -210,5 +225,46 @@ private function assertHeader($header) if ($header === '') { throw new \InvalidArgumentException('Header name can not be empty.'); } + + if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/', $header)) { + throw new \InvalidArgumentException( + sprintf( + '"%s" is not valid header name', + $header + ) + ); + } + } + + /** + * @param string $value + * + * @return void + * + * @see https://tools.ietf.org/html/rfc7230#section-3.2 + * + * field-value = *( field-content / obs-fold ) + * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] + * field-vchar = VCHAR / obs-text + * VCHAR = %x21-7E + * obs-text = %x80-FF + * obs-fold = CRLF 1*( SP / HTAB ) + */ + private function assertValue($value) + { + // The regular expression intentionally does not support the obs-fold production, because as + // per RFC 7230#3.2.4: + // + // A sender MUST NOT generate a message that includes + // line folding (i.e., that has any field-value that contains a match to + // the obs-fold rule) unless the message is intended for packaging + // within the message/http media type. + // + // Clients must not send a request with line folding and a server sending folded headers is + // likely very rare. Line folding is a fairly obscure feature of HTTP/1.1 and thus not accepting + // folding is not likely to break any legitimate use case. + if (! preg_match('/^[\x20\x09\x21-\x7E\x80-\xFF]*$/', $value)) { + throw new \InvalidArgumentException(sprintf('"%s" is not valid header value', $value)); + } } }