Repository navigation
clone_request() mutates the original request's parser_context #10107
Replies: 1 comment
|
I can confirm this on current master (f9c0ec5). On the impact, since that decides how urgent it is: the clones happen in three places, Where it does show is a custom parser that reads anything specific to the DRF Your fix looks right to me. A shallow copy is enough, because |
Uh oh!
There was an error while loading. Please reload this page.
Description
clone_request()passes the original request'sparser_contextdictionary directly to the clonedRequest.The
Request.__init__()method assignsselftoself.parser_context['request'].Since both requests share the same dictionary, creating a clone overwrites the original request's parser context.
Steps to reproduce
Actual result
Expected result
Cloning a request should not change the original request's parser context.
Suggested fix
Pass a separate dictionary to the cloned request:
Environment
All reactions