Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
f6329b7b
Commit
f6329b7b
authored
Apr 14, 2014
by
Xavier Ordoquy
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1529 from vlastv/patch-1
Fixed parse file name
parents
93b9245b
063addab
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
rest_framework/parsers.py
+1
-1
rest_framework/tests/test_parsers.py
+1
-1
No files found.
rest_framework/parsers.py
View file @
f6329b7b
...
@@ -288,7 +288,7 @@ class FileUploadParser(BaseParser):
...
@@ -288,7 +288,7 @@ class FileUploadParser(BaseParser):
try
:
try
:
meta
=
parser_context
[
'request'
]
.
META
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'
]
return
disposition
[
1
][
'filename'
]
except
(
AttributeError
,
KeyError
):
except
(
AttributeError
,
KeyError
):
pass
pass
rest_framework/tests/test_parsers.py
View file @
f6329b7b
...
@@ -96,7 +96,7 @@ class TestFileUploadParser(TestCase):
...
@@ -96,7 +96,7 @@ class TestFileUploadParser(TestCase):
request
=
MockRequest
()
request
=
MockRequest
()
request
.
upload_handlers
=
(
MemoryFileUploadHandler
(),)
request
.
upload_handlers
=
(
MemoryFileUploadHandler
(),)
request
.
META
=
{
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
,
'HTTP_CONTENT_LENGTH'
:
14
,
}
}
self
.
parser_context
=
{
'request'
:
request
,
'kwargs'
:
{}}
self
.
parser_context
=
{
'request'
:
request
,
'kwargs'
:
{}}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment