Repository: guzzle/psr7 (php)

Issue:
Urgent - v2.1.1 - MessageTrait assertValue broken
**PHP version**: 7.4.27 (hint: `php --version`)

**Description**
I updated my dependencies, and guzzlehttp/psr7 was updated to v2.1.1. This broke an integration with a third party API that I'm working with. (Largest credit card payment processor in Scandiavia).

I have traced it down to the changes introduced in MessageTrait for the method `assertValue`.
When the response (which I am not in control over), contains the following header, I get an InvalidArgumentException XXX is not a valid header value.

```
X-Iinfo: 12-34567890-123456789 AAAA BC(12 34 5) DE(1234567890123 123) a(1 2 3 4) b(1 2) A1
```

I have changed the actual values from the header, as I'm not sure if it contains confidential information. The relevant part here is the whitespaces, which failes the parsing introduced in 2.1.1.


**How to reproduce**
Add the above header to a response.

**Possible Solution**
Revert the changes done in 2.1.1 back to the behavior in 2.1.0

**Additional context**



Pull request description:
Release 2.1.2
Closes #489.

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bfbd193..9170442 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## Unreleased
 
+## 2.1.2 - 2022-03-20
+
+### Fixed
+
+- Correct header value validation
+
 ## 2.1.1 - 2022-03-20
 
 ### Fixed
diff --git a/src/MessageTrait.php b/src/MessageTrait.php
index 809502c..a8696b9 100644
--- a/src/MessageTrait.php
+++ b/src/MessageTrait.php
@@ -259,7 +259,7 @@ trait MessageTrait
         // 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('/^(?:[\x21-\x7E\x80-\xFF](?:[\x20\x09]+[\x21-\x7E\x80-\xFF])?)*$/', $value)) {
+        if (! preg_match('/^[\x20\x09\x21-\x7E\x80-\xFF]*$/', $value)) {
             throw new \InvalidArgumentException(sprintf('"%s" is not valid header value', $value));
         }
     }


Test patch:
diff --git a/tests/RequestTest.php b/tests/RequestTest.php
index f8c04bf..71d90b2 100644
--- a/tests/RequestTest.php
+++ b/tests/RequestTest.php
@@ -176,6 +176,17 @@ class RequestTest extends TestCase
         ], $r->getHeaders());
     }
 
+    public function testHeaderValueWithWhitespace(): void
+    {
+        $r = new Request('GET', 'https://example.com/', [
+            'User-Agent' => 'Linux f0f489981e90 5.10.104-linuxkit 1 SMP Wed Mar 9 19:05:23 UTC 2022 x86_64'
+        ]);
+        self::assertSame([
+            'Host' => ['example.com'],
+            'User-Agent' => ['Linux f0f489981e90 5.10.104-linuxkit 1 SMP Wed Mar 9 19:05:23 UTC 2022 x86_64']
+        ], $r->getHeaders());
+    }
+
     public function testCanGetHeaderAsCsv(): void
     {
         $r = new Request('GET', 'http://foo.com/baz?bar=bam', [