-
Notifications
You must be signed in to change notification settings - Fork 392
Fixing content-security-policy for IE 10 / 11 #44
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
Conversation
Headers are lower cased and the agent name was changed to the key of the AGENTS objects.
The sandbox directive was added to IE 10 / 11 when no security policy was specified. This only sets the sandbox directive when it's explicitly defined. Furthermore, platform.js was mis-detecting IE11 as Firefox. This adds stop-gap detection of IE11 until this pull request is merged into platform.js: bestiejs/platform.js#57 Fixes #42
|
It looks like I was mistaken about the user agent IE11 uses, going to correct. This pull request will detect IE11 for you, or you can wait until platform.js is updated and support IE11 then. |
|
I think it'd be good to merge this now to support IE11 ASAP and push a patch version, and then when/if |
|
@EvanHahn / @evilpacket -- the pull request I did on platform.js prompted them to update the npm repo. They now detect IE11 (but not IE11 masked as other browsers). I bumped the version of platform.js listed in package.json so this no longer has IE 11 specific detection. |
|
@EvanHahn The tests for IE/Safari are still broken.
Expected: Actual: The problem is that the headers are actually returned lower case -- so the assert is asserting something that is always true. Instead of: You need: The same applies for this test: Instead of: It needs to be: |
|
With those changes you'll see that the tests fail (as they should). |
This fixes #42.
Platform.js has a bug where it was mis-detecting IE11 as Firefox, that has a PR here: bestiejs/platform.js#57
This includes code to detect IE11 correctly until the platform.js PR is merged in (alternatively, you can wait for that request to be released and bump the platform.js version).
This PR also includes code that fixes some typos with CSP test suite, headers are sent back lowercased so the test
assert(res.header['X-Content-Security-Policy'] === undefined);would always return true.