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 issue 1513: YUI violates Content-Security-Policy #1514

Closed
wants to merge 1 commit into from
Closed

Fix issue 1513: YUI violates Content-Security-Policy #1514

wants to merge 1 commit into from

Conversation

gerardkcohen
Copy link
Contributor

Simple change to remove use of 'eval' like code from yui.js in order to satisfy any strict Content-Security-Policy headers.

Ran complete unit tests with YETI on my OSX Version 10.8.2 with Chrome Version 31.0.1650.63, Safari Version 6.0.2 (8536.26.17), and Firefox Version: 17.

@juandopazo
Copy link
Member

That will fail with strict mode. What we need to do is wrap the whole of the YUI definition in:

(function (global) {
//...
}(this));

@caridy
Copy link
Member

caridy commented Jan 9, 2014

@juandopazo that will not work in nodejs because this is pointing to module when using it thru require() and pointing to global when using it thru node <script.js>.

@juandopazo
Copy link
Member

(function (global) {
  'use strict';
  // ...
}(typeof global !== 'undefined' ? global : this));

Yuck.

@gerardkcohen
Copy link
Contributor Author

Could we, at the very least, merge as is while more thought is put into using strict mode, supporting node, etc? As it stands now, any organizations implementing CSP, ie large financial institutions (wink wink), will block running YUI.

@okuryu
Copy link
Member

okuryu commented Sep 29, 2014

Fixed in #1963.

@okuryu okuryu closed this Sep 29, 2014
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.

4 participants