Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[httpClient] NO_PROXY option is ignored in NativeHttpClient::request() method  #33832

Copy link
Copy link
Closed
@Harry-Dunne

Description

@Harry-Dunne
Issue body actions

Symfony version(s) affected: 4.3.4

Description
Overriding HTTP Proxy settings in $options argument passed to NativeHttpClient::request() method works for "proxy" option but doesn't work for "no_proxy" option.

How to reproduce

Call the NativeHttpClient::request() method with options overriding your proxy settings in environment variables:

$client = HttpClient::create();
$client->request('GET', 'http://my-host.com/', [
    'no_proxy' => 'my-host',
]);

Possible Solution

I think that the bug lies in this line:

https://github.com/symfony/http-client/blob/92ceb25f8c850d4ec8bce9234c8001c5b32d8387/NativeHttpClient.php#L224

Possible fix:

$noProxy = $options['no_proxy'] ?? $_SERVER['no_proxy'] ?? $_SERVER['NO_PROXY'] ?? '';

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.