koenbuyens / securityheaders

Check any website (or set of websites) for insecure security headers.
Apache License 2.0
244 stars 50 forks source link

Broken tests on CSP #5

Open upils opened 5 years ago

upils commented 5 years ago

Unittests on CSP are broken.

self.assertTrue(self.csphash.policyHasScriptHashes())
self.assertTrue(self.csphashcamel.policyHasScriptHashes())

These two are failing. because initialization of the class CSPDirective seems to get rid of second value in tuples such as CHILD_SRC. This causes a wrong handling of directives in camelCase.

I'm not sure to really understand why you define a tuple, but then use directive as a single value in functions such as getEffectiveDirective(). Could you provide some explanation ?