mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 04:50:12 +03:00
fix parser_context bug in MultiPartParser
This commit is contained in:
parent
6d48223a35
commit
806b31b880
|
@ -98,13 +98,17 @@ class MultiPartParser(BaseParser):
|
|||
`.data` will be a `QueryDict` containing all the form parameters.
|
||||
`.files` will be a `QueryDict` containing all the form files.
|
||||
"""
|
||||
meta = {}
|
||||
upload_handlers = []
|
||||
parser_context = parser_context or {}
|
||||
if 'request' in parser_context:
|
||||
request = parser_context['request']
|
||||
encoding = parser_context.get('encoding', settings.DEFAULT_CHARSET)
|
||||
meta = request.META.copy()
|
||||
meta['CONTENT_TYPE'] = media_type
|
||||
upload_handlers = request.upload_handlers
|
||||
|
||||
meta['CONTENT_TYPE'] = media_type
|
||||
encoding = parser_context.get('encoding', settings.DEFAULT_CHARSET)
|
||||
|
||||
try:
|
||||
parser = DjangoMultiPartParser(meta, stream, upload_handlers, encoding)
|
||||
data, files = parser.parse()
|
||||
|
|
Loading…
Reference in New Issue
Block a user