Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug when @csp arguments were strings #51

Merged
merged 2 commits into from
Apr 21, 2016

Conversation

Flimm
Copy link
Contributor

@Flimm Flimm commented Feb 12, 2016

The bug was causing this code:

@csp(IMG_SRC='imgsrv2.com')
def view(request):
     # ....

to emit headers like Content-Security-Policy: img-src i m g s r v 2 . c o m

I fixed the bug, and I changed the documentation to instruct users to use lists or tuples for consistency
with the configuration.

In documentation, instruct users to use lists or tuples for consistency
with the configuration.
eq_(response._csp_config,
{'img-src': ['foo.com'], 'font-src': ['bar.com']})
mw.process_response(REQUEST, response)
eq_(policy_list, ["font-src bar.com", "img-src foo.com"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

policy_list is not defined here and it's causing the test to fail.

@muffinresearch
Copy link
Contributor

@Flimm Would you be able to fixup the test failure?

@Flimm
Copy link
Contributor Author

Flimm commented Apr 14, 2016

Sorry, I'm not sure how I missed that. It's fixed now.

@EnTeQuAk EnTeQuAk merged commit 2ba139a into mozilla:master Apr 21, 2016
@muffinresearch
Copy link
Contributor

Thanks @Flimm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants