diff test/test_liveserver.py @ 7159:765222ef4cec

- issue2551257: add 'X-Content-Type-Options: nosniff' header for file download when downloading an attached (user supplied file), make sure that an 'X-Content-Type-Options: nosniff' header is sent. Added test for header as well.
author John Rouillard <rouilj@ieee.org>
date Thu, 23 Feb 2023 16:20:32 -0500
parents a9be849d4dd2
children 273c8c2b5042
line wrap: on
line diff
--- a/test/test_liveserver.py	Thu Feb 23 16:02:51 2023 -0500
+++ b/test/test_liveserver.py	Thu Feb 23 16:20:32 2023 -0500
@@ -1197,6 +1197,7 @@
         # download file and verify content
         f = session.get(self.url_base()+'/file%(file)s/text1.txt'%m.groupdict())
         self.assertEqual(f.text, file_content)
+        self.assertEqual(f.headers["X-Content-Type-Options"], "nosniff")
         print(f.text)
 
     def test_new_file_via_rest(self):

Roundup Issue Tracker: http://roundup-tracker.org/