fix: use current request instead of original in redirect chain#85
Open
label-hook[bot] wants to merge 1217 commits into
Open
fix: use current request instead of original in redirect chain#85label-hook[bot] wants to merge 1217 commits into
label-hook[bot] wants to merge 1217 commits into
Conversation
Add clarification to MissingSchema error
Use builtin_str for all auto-set header values.
otherwise python3.4 warns
close files in setup.py
Modified the tests so that they use py.test convention
restoring pull request fixing psf#1623
Improve the PreparedRequest docs.
Fix for AppEngine
loosen URL handling for non-native protocols
One last Charade reference to remove here.
Reference at the earliest opportunity that Server-Name-Indication is a limitation of Python 2.6 and 2.7. Avoid describing it as a Requests issue.
Made `.status_code` and `.reason` consistent with one another, adding some examples. Addresses psf#1225.
Document the `Response.reason` attribute.
Remove unused loggers.
…coding Reinstate falling back to self.text for JSON responses
Document requirements for SNI support on Python2
Add request to RequestException
New Response property, .is_redirect.
- Regardless of whether they are on the session or not - Fixes psf#1920
The timeout is in seconds.
- Charade is gone, long live Chardet. - cacert.pem is now taken wholesale from Mozilla so we need to display that itis licensed under the MPL2.0
Fixes Issue psf#1803
Charade -> Chardet and Add cacert.pem license
Do not set headers with None value
Add timeout to stream with testing
Some people will assume that .raw() is present, and they shouldn't get AttributeErrors when they make that assumption on a pickled Response. However, @kennethreitz has asked that we not be too dependent on urllib3. For that reason, set to None.
Pickled Responses should include a None value for the raw attribute
Fix Accept-Encoding in default headers
…est instead of original
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes an issue in
Session.resolve_redirectswhere the method incorrectly copied the original request for each redirect iteration instead of using the current/modified request. This caused incorrect method selection when a redirect chain included method-changing redirects (like 303 See Other) followed by method-preserving redirects (like 307 Temporary Redirect).Changes
Session.resolve_redirectsinrequests/sessions.pyto use the current prepared request as the base for subsequent redirectsTesting
The fix was validated against the existing test suite. While the baseline test suite had pre-existing failures unrelated to this change, no new test failures were introduced by this modification. The change specifically addresses the redirect chain scenario described in the issue where:
Closes #84
Closes #84