summaryrefslogtreecommitdiff
path: root/tests/utils_tests/test_http.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2014-05-12 07:28:07 -0400
committerFlorian Apolloner <florian@apolloner.eu>2014-05-14 10:19:48 +0200
commit3800f63721f6fc1c940abfb10fe21257dcf13521 (patch)
treea76981345ac774a9957da50b0c457a9dcf5a5dbd /tests/utils_tests/test_http.py
parenta06808d370ab2216562720efde1fd3e4f85486ad (diff)
Dropped fix_IE_for_vary/attach.
This is a security fix. Disclosure following shortly.
Diffstat (limited to 'tests/utils_tests/test_http.py')
-rw-r--r--tests/utils_tests/test_http.py46
1 files changed, 0 insertions, 46 deletions
diff --git a/tests/utils_tests/test_http.py b/tests/utils_tests/test_http.py
index 9f6bcce830..edd0fde44f 100644
--- a/tests/utils_tests/test_http.py
+++ b/tests/utils_tests/test_http.py
@@ -2,8 +2,6 @@ from datetime import datetime
import sys
import unittest
-from django.http import HttpResponse, utils
-from django.test import RequestFactory
from django.utils.datastructures import MultiValueDict
from django.utils import http
from django.utils import six
@@ -67,50 +65,6 @@ class TestUtilsHttp(unittest.TestCase):
]
self.assertTrue(result in acceptable_results)
- def test_fix_IE_for_vary(self):
- """
- Regression for #16632.
-
- `fix_IE_for_vary` shouldn't crash when there's no Content-Type header.
- """
-
- # functions to generate responses
- def response_with_unsafe_content_type():
- r = HttpResponse(content_type="text/unsafe")
- r['Vary'] = 'Cookie'
- return r
-
- def no_content_response_with_unsafe_content_type():
- # 'Content-Type' always defaulted, so delete it
- r = response_with_unsafe_content_type()
- del r['Content-Type']
- return r
-
- # request with & without IE user agent
- rf = RequestFactory()
- request = rf.get('/')
- ie_request = rf.get('/', HTTP_USER_AGENT='MSIE')
-
- # not IE, unsafe_content_type
- response = response_with_unsafe_content_type()
- utils.fix_IE_for_vary(request, response)
- self.assertTrue('Vary' in response)
-
- # IE, unsafe_content_type
- response = response_with_unsafe_content_type()
- utils.fix_IE_for_vary(ie_request, response)
- self.assertFalse('Vary' in response)
-
- # not IE, no_content
- response = no_content_response_with_unsafe_content_type()
- utils.fix_IE_for_vary(request, response)
- self.assertTrue('Vary' in response)
-
- # IE, no_content
- response = no_content_response_with_unsafe_content_type()
- utils.fix_IE_for_vary(ie_request, response)
- self.assertFalse('Vary' in response)
-
def test_base36(self):
# reciprocity works
for n in [0, 1, 1000, 1000000]: