diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2014-05-12 07:28:07 -0400 |
|---|---|---|
| committer | Florian Apolloner <florian@apolloner.eu> | 2014-05-14 10:18:26 +0200 |
| commit | 7fef18ba9e5a8b47bc24b5bb259c8bf3d3879f2a (patch) | |
| tree | 69c1ede3b8a3d552f56618132ac6186c7a17b14f /tests | |
| parent | 50f228ae7c7d5eb68c1544423dcb3dfa31f2dc74 (diff) | |
[1.7.x] Dropped fix_IE_for_vary/attach.
This is a security fix. Disclosure following shortly.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/utils_tests/test_http.py | 46 |
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]: |
