From: David Kerkeslager Date: Sat, 14 Dec 2019 00:01:44 +0000 (-0500) Subject: Fix a bug in the header generation X-Git-Url: https://code.kerkeslager.com/?p=fwx;a=commitdiff_plain;h=7b02629c8e924154857f35cef1364bef66fe3b75 Fix a bug in the header generation --- diff --git a/src/fwx/__init__.py b/src/fwx/__init__.py index d26083b..6ee7541 100644 --- a/src/fwx/__init__.py +++ b/src/fwx/__init__.py @@ -158,7 +158,7 @@ class Response(_Response): 'Content-Type': self.content_type, } - for key, value in builtin_headers: + for key, value in builtin_headers.items(): if key in result: raise Exception('Header "{}" defined twice'.format(key)) else: diff --git a/src/test_fwx.py b/src/test_fwx.py index f437964..97a7f74 100644 --- a/src/test_fwx.py +++ b/src/test_fwx.py @@ -49,6 +49,7 @@ class ResponseTests(unittest.TestCase): response.headers, ( ('Content-Type', 'text/plain'), + ('X-Content-Type-Options', 'nosniff'), ), )