php-http / client-common

Common HTTP Client implementations and tools for HTTPlug
http://httplug.io
MIT License
1.01k stars 53 forks source link

Added `strict` option for RedirectPlugin not to modify request method… #208

Closed olexiyk closed 3 years ago

olexiyk commented 3 years ago

… on statuses 300, 301, 302

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets fixes #207, partially #205
License MIT

What's in this PR?

Resolves #207 by allowing to follow redirect specs for 301 and 302 more strictly - not modifying request method

Example Usage

        $plugins = $plugins ?? [
            new RedirectPlugin(['strict' => true]),
        ];

        $httpClient = (new PluginClientFactory())->createClient(
            Psr18ClientDiscovery::find(),
            $plugins
        );

Checklist

To Do

dbu commented 3 years ago

i tagged 2.4.0 with this feature. thanks for the contribution!

olexiyk commented 3 years ago

Thank you for quick action!