mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Refs #30227 -- Added helpful message for non-ASCII Content-Type in mulitpart request.
This commit is contained in:
parent
2ed2acf872
commit
8ec7ded370
2 changed files with 15 additions and 1 deletions
|
@ -487,6 +487,17 @@ class RequestsTests(SimpleTestCase):
|
|||
with self.assertRaisesMessage(MultiPartParserError, 'Invalid boundary in multipart: None'):
|
||||
request.POST
|
||||
|
||||
def test_multipart_non_ascii_content_type(self):
|
||||
request = WSGIRequest({
|
||||
'REQUEST_METHOD': 'POST',
|
||||
'CONTENT_TYPE': 'multipart/form-data; boundary = \xe0',
|
||||
'CONTENT_LENGTH': 0,
|
||||
'wsgi.input': FakePayload(),
|
||||
})
|
||||
msg = 'Invalid non-ASCII Content-Type in multipart: multipart/form-data; boundary = à'
|
||||
with self.assertRaisesMessage(MultiPartParserError, msg):
|
||||
request.POST
|
||||
|
||||
def test_POST_connection_error(self):
|
||||
"""
|
||||
If wsgi.input.read() raises an exception while trying to read() the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue