Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom header triggers error not valid header value #2998

Closed
it-can opened this issue Mar 20, 2022 · 2 comments
Closed

Custom header triggers error not valid header value #2998

it-can opened this issue Mar 20, 2022 · 2 comments

Comments

@it-can
Copy link

it-can commented Mar 20, 2022

Guzzle version(s) affected: 7.4
PHP version: 8.1.4
cURL version: 7.82.0

Description
I was testing this library (mollie/mollie-api-php#612), which sets a custom header with php_uname(). And my docker returns this value: Linux f0f489981e90 5.10.104-linuxkit #1 SMP Wed Mar 9 19:05:23 UTC 2022 x86_64. This will trigger an error

"Linux f0f489981e90 5.10.104-linuxkit #1 SMP Wed Mar 9 19:05:23 UTC 2022 x86_64" is not valid header value

How to reproduce

<?php
$header = 'Linux f0f489981e90 5.10.104-linuxkit 1 SMP Wed Mar 9 19:05:23 UTC 2022 x86_64';

$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://enswyqyojtxm.x.pipedream.net', [
    'headers' => [
        'User-Agent' => 'testing/1.0',
        'Accept'     => 'application/json',
        'X-Foo'      => ['Bar', 'Baz'],
        'X-TEST'     => $header,
    ]
]);

Possible Solution

Additional context
I tested the whole 7.4 branch but the "problem" seems to be within guzzlehttp/psr7. This line https://github.com/guzzle/psr7/blob/master/src/MessageTrait.php#L262

@it-can
Copy link
Author

it-can commented Mar 20, 2022

Problem seems to be with the PSR7 library. Feel free to close this issue...

@GrahamCampbell
Copy link
Member

Duplicate of guzzle/psr7#489.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants