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