summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2013-08-24 18:08:05 +0200
committerClaude Paroz <claude@2xlibre.net>2013-08-24 18:10:50 +0200
commit2c08d474a83b438cf02595c6854f2f79e708b852 (patch)
treed0fc36d074db6e70076277b1e033a53fb9569810 /tests
parent2a166623a63b27a2b6c5c9d0f46bd726ee4e82fb (diff)
[1.6.x] Fixed #20961 -- Fixed HttpResponse default empty content
Thanks epandurski at gmail.com for the report. Backport of f4e980456 from master.
Diffstat (limited to 'tests')
-rw-r--r--tests/httpwrappers/tests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/httpwrappers/tests.py b/tests/httpwrappers/tests.py
index c4c7996aa5..8e0c415623 100644
--- a/tests/httpwrappers/tests.py
+++ b/tests/httpwrappers/tests.py
@@ -398,6 +398,13 @@ class HttpResponseTests(unittest.TestCase):
self.assertEqual(r.tell(), 6)
self.assertEqual(r.content, b'abcdef')
+ # with Content-Encoding header
+ r = HttpResponse()
+ r['Content-Encoding'] = 'winning'
+ r.write(b'abc')
+ r.write(b'def')
+ self.assertEqual(r.content, b'abcdef')
+
def test_unsafe_redirect(self):
bad_urls = [
'data:text/html,<script>window.alert("xss")</script>',