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

Rules are modified without being cloned, permanently mutating options object #47

Closed
baconmania opened this issue Jun 2, 2014 · 0 comments · Fixed by #48
Closed

Rules are modified without being cloned, permanently mutating options object #47

baconmania opened this issue Jun 2, 2014 · 0 comments · Fixed by #48

Comments

@baconmania
Copy link
Contributor

The problem is in these two lines:
https://github.com/evilpacket/helmet/blob/master/lib/middleware/csp.js#L129
https://github.com/evilpacket/helmet/blob/master/lib/middleware/csp.js#L137

At both of those lines, policy[key] points to options[key] by reference. This modifies options for all future requests, and is not the desired behavior.

baconmania added a commit to baconmania/helmet that referenced this issue Jun 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant