mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-23 10:03:57 +03:00
commit
f6329b7b5d
|
@ -288,7 +288,7 @@ class FileUploadParser(BaseParser):
|
|||
|
||||
try:
|
||||
meta = parser_context['request'].META
|
||||
disposition = parse_header(meta['HTTP_CONTENT_DISPOSITION'])
|
||||
disposition = parse_header(meta['HTTP_CONTENT_DISPOSITION'].encode('utf-8'))
|
||||
return disposition[1]['filename']
|
||||
except (AttributeError, KeyError):
|
||||
pass
|
||||
|
|
|
@ -96,7 +96,7 @@ class TestFileUploadParser(TestCase):
|
|||
request = MockRequest()
|
||||
request.upload_handlers = (MemoryFileUploadHandler(),)
|
||||
request.META = {
|
||||
'HTTP_CONTENT_DISPOSITION': 'Content-Disposition: inline; filename=file.txt'.encode('utf-8'),
|
||||
'HTTP_CONTENT_DISPOSITION': 'Content-Disposition: inline; filename=file.txt',
|
||||
'HTTP_CONTENT_LENGTH': 14,
|
||||
}
|
||||
self.parser_context = {'request': request, 'kwargs': {}}
|
||||
|
|
Loading…
Reference in New Issue
Block a user