-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Http redirects are not followed when using caching http client #38207
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
Labels
Comments
dmolineus
added a commit
to phpcq/repository-builder
that referenced
this issue
Sep 16, 2020
Redirects are not handled by the cached http client, see symfony/symfony#38207
This line should be removed, it's a left over from BrowseKit. |
I checked the browser kit, it forces symfony/src/Symfony/Component/BrowserKit/HttpBrowser.php Lines 50 to 54 in 237d91f
|
fabpot
added a commit
that referenced
this issue
Sep 17, 2020
…lientKernel (dmolineus) This PR was squashed before being merged into the 4.4 branch. Discussion ---------- [HttpKernel] Do not override max_redirects option in HttpClientKernel | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #38207 | License | MIT | Doc PR | - As [proposed](#38207 (comment)) by @nicolas-grekas this pull request removes the `max_redirects` setting in the `\Symfony\Component\HttpKernel\HttpClientKernel::handle` method. It solves the issue that requests made by the `\Symfony\Component\HttpClient\CachingHttpClient` wouldn't follow redirects as described in the linked issue. Commits ------- 981a11b [HttpKernel] Do not override max_redirects option in HttpClientKernel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Symfony version(s) affected:
^4.3.0
Description
I use the http client for a
GET
request. By default an instance ofSymfony\Component\HttpClient\HttpClient
follows redirects (by default up to 20). When using theSymfony\Component\HttpClient\CachingHttpClient
every redirect leads to an exception.The issue is caused by the
Symfony\Component\HttpKernel\HttpClientKernel
which overrides themax_redirects
option:symfony/src/Symfony/Component/HttpKernel/HttpClientKernel.php
Lines 53 to 57 in 9c8cd08
How to reproduce
Additional context
The text was updated successfully, but these errors were encountered: