Skip to content

Conversation

@olexiyk
Copy link
Contributor

@olexiyk olexiyk commented Jul 2, 2021

… 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

  • Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix
  • Documentation pull request created (if not simply a bugfix)

To Do

  • If the PR is not complete but you want to discuss the approach, list what remains to be done here

Copy link
Contributor

@dbu dbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the pull request and the detailed explanation. this makes sense to me 👍

can you update https://github.com/php-http/documentation/blob/master/plugins/redirect.rst for the documentation please?

added more details on the change

Co-authored-by: David Buchmann <[email protected]>
Copy link
Contributor

@dbu dbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks again!

@dbu dbu merged commit c754501 into php-http:master Jul 3, 2021
@olexiyk olexiyk deleted the redirect-plugin-strict branch July 5, 2021 08:05
@dbu
Copy link
Contributor

dbu commented Jul 5, 2021

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

@olexiyk
Copy link
Contributor Author

olexiyk commented Jul 5, 2021

Thank you for quick action!

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

Successfully merging this pull request may close these issues.

Add an option for RedirectPlugin not to modify request on statuses 300, 301, 302

2 participants