-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Support Reusable Request Bodies and Improve Payload Handling #11017
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
Merged
Merged
Changes from all commits
Commits
Show all changes
132 commits
Select commit
Hold shift + click to select a range
ec80c6b
Handle reusing payloads
bdraco a3e82be
reuse
bdraco 840a93e
reuse
bdraco 81ac0b0
reuse
bdraco 556fc82
reuse
bdraco 35c702c
reuse
bdraco 8ef083e
reuse
bdraco a18d0f2
reuse
bdraco aee40da
reuse
bdraco 857ede9
reuse
bdraco d370d4d
reuse
bdraco 182d504
reuse
bdraco 3b5cbe5
reuse
bdraco 47f73f2
reuse
bdraco b9b33b2
reuse
bdraco b595830
reuse
bdraco 955e7e2
reuse
bdraco a819999
reuse
bdraco d568481
reuse
bdraco 78f3cab
cleanup
bdraco 569cb2c
cleanup
bdraco cd4d498
cleanup
bdraco 460c17a
Merge branch 'master' into digest_body
bdraco b9b19f6
cleanup
bdraco 37ae85d
cleanup
bdraco 7592e75
cleanup
bdraco 5dc838c
avoid expensive isintance changes
bdraco 3904762
avoid expensive isintance changes
bdraco fb34beb
sane default
bdraco d4fcedb
sane default
bdraco 840cd23
sane default
bdraco bb4ca30
sane default
bdraco 223a243
sane default
bdraco c1e5055
sane default
bdraco 175f7f1
sane default
bdraco d64e8e8
ignore now that its not typed to Any
bdraco f08d4c6
ignore now that its not typed to Any
bdraco 530b3cf
ignore now that its not typed to Any
bdraco 284f1cd
fixes
bdraco ab928e5
fixes
bdraco 514dd25
fixes
bdraco 62b5162
fixes
bdraco 56e2943
fixes
bdraco ce9eb93
fixes
bdraco cf23943
fixes
bdraco bd6d2dc
fixes
bdraco c58eb76
fixes
bdraco 33c7d4b
fixes
bdraco 458b6fa
fixes
bdraco f3847ae
fixes
bdraco 3fe3de2
fixes
bdraco ed9d184
fixes
bdraco abc906b
feedback
bdraco a2d3e24
feedback
bdraco b643637
feedback
bdraco c80dc6b
docs
bdraco f06cef9
docs
bdraco 15d6b6d
docs
bdraco d2a7091
docs
bdraco c35f325
docs
bdraco 6ccdb92
fixes
bdraco 3e4b8c7
lint
bdraco efdc225
changelog
bdraco 78a946c
docs
bdraco 1c3871b
docs
bdraco 207fa61
Revert "docs"
bdraco 201aaeb
Revert "docs"
bdraco f755882
Revert "changelog"
bdraco 9e27a63
docs
bdraco a9adeed
fixes
bdraco 4778d86
fixes
bdraco 5a372bc
fixes
bdraco cf21075
remove unneeded code
bdraco d5378fe
remove unneeded code
bdraco 464f1fa
payload reuse tests
bdraco 2fe5896
make sure original PR intent is captured
bdraco 6a0fc3f
multipart reuse
bdraco 530dff1
adjust test since you can reuse now
bdraco 945e771
make size reentrant
bdraco db5e3d6
make size reentrant
bdraco 3c606dc
lint
bdraco c2d3c59
digest middleware types
bdraco 48128f9
dry
bdraco 2c7651b
make sure we donnot call as_bytes on BodyPartReaderPayload
bdraco bc270c1
payload warnings test
bdraco 1d4f446
redirect failures close payload
bdraco ae892b0
coverage
bdraco 989e9e4
safer
bdraco 751e48f
add back compat test for as_bytes
bdraco b30d8eb
lint
bdraco 749592a
middleware update_body
bdraco b222d8d
fix setting empty body
bdraco d98335b
make sure to reference original pr
bdraco 51f4740
do not make them do it
bdraco 6372b05
size seems to be ok
bdraco 33a1d6e
better tests for longer and shorter body
bdraco fc4b029
better tests for longer and shorter body
bdraco 15ba9e7
fix reset
bdraco c9d86b0
fix reset
bdraco 9b2fc5d
type it out
bdraco f6e2093
test gap, docs
bdraco b5411cc
missing a branch
bdraco aff2ca2
keep current design
bdraco 08ca748
lint
bdraco 378b60f
make sure emojis will not break us
bdraco 9fc89d1
lint
bdraco af0f012
unreach
bdraco 737c57e
unreach
bdraco 759a677
Merge branch 'master' into digest_body
bdraco 73130ec
tweak
bdraco fd277f3
fix reference
bdraco 6a7bb45
do not leak on body setter either
bdraco 498b796
Merge remote-tracking branch 'upstream/digest_body' into digest_body
bdraco 55982b0
cover
bdraco 690a20e
cleanup
bdraco 7d75e50
make resource warning make sense
bdraco 18f8147
write never called
bdraco b675db7
fix comment
bdraco 5c40ce3
fix bug in textio decode
bdraco bda371c
make multipart close safe against partial close failures
bdraco 1c1deb2
fix stack level for body setter
bdraco d3e2488
fix stack level on resource warnings
bdraco d3e3314
stack
bdraco e17a3a8
lint
bdraco be21e11
keep readlines since it promises bytes
bdraco 445032d
use internal logger
bdraco 2b0f33a
add coverage for body clear during continue
bdraco 378823d
comment
bdraco 3e9e4a5
fix missing mock that made test flakey
bdraco dcfcbde
cover
bdraco 69c6a66
add test for corner case
bdraco 7be3123
add test for corner case
bdraco File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Added support for reusable request bodies to enable retries, redirects, and digest authentication -- by :user:`bdraco` and :user:`GLGDLY`. | ||
|
||
Most payloads can now be safely reused multiple times, fixing long-standing issues where POST requests with form data or file uploads would fail on redirects with errors like "Form data has been processed already" or "I/O operation on closed file". This also enables digest authentication to work with request bodies and allows retry mechanisms to resend requests without consuming the payload. Note that payloads derived from async iterables may still not be reusable in some cases. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
11017.feature.rst |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
11017.feature.rst |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
11017.feature.rst |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.