mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[1.6.x] Fixed #20961 -- Fixed HttpResponse default empty content
Thanks epandurski at gmail.com for the report.
Backport of f4e980456 from master.
This commit is contained in:
@@ -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>',
|
||||
|
||||
Reference in New Issue
Block a user