From 4964ec8b37f129d8539374b1a00c6010cd69f5a0 Mon Sep 17 00:00:00 2001 From: Ryan P Kilby Date: Fri, 7 Jul 2017 11:31:47 -0400 Subject: [PATCH] Set data & file refs on underlying Django request --- rest_framework/request.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rest_framework/request.py b/rest_framework/request.py index ffbe4a367..e4c07e2c5 100644 --- a/rest_framework/request.py +++ b/rest_framework/request.py @@ -250,6 +250,11 @@ class Request(object): else: self._full_data = self._data + # copy data & files refs to the underlying request so that closable + # objects are handled appropriately. + self._request._post = self._data + self._request._files = self._files + def _load_stream(self): """ Return the content body of the request, as a stream.