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

Prevent unnecessary meta + reportOnly warning #134

Merged
merged 2 commits into from
Apr 8, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,14 @@ module.exports = {
let config = type === 'head' ? this._config : this._configForTest;
let policyString = type === 'head' ? this._policyString : this._policyStringForTest;

this.ui.writeWarnLine(
'Content Security Policy does not support report only mode if delivered via meta element. ' +
"Either set `ENV['ember-cli-content-security-policy'].reportOnly` to `false` or remove `'meta'` " +
"from `ENV['ember-cli-content-security-policy'].delivery`.",
config.reportOnly
);
if (this._config.reportOnly && this._config.delivery.indexOf('meta') !== -1) {
this.ui.writeWarnLine(
'Content Security Policy does not support report only mode if delivered via meta element. ' +
"Either set `ENV['ember-cli-content-security-policy'].reportOnly` to `false` or remove `'meta'` " +
"from `ENV['ember-cli-content-security-policy'].delivery`.",
config.reportOnly
);
}
jelhan marked this conversation as resolved.
Show resolved Hide resolved

unsupportedDirectives(config.policy).forEach(function(name) {
let msg = 'CSP delivered via meta does not support `' + name + '`, ' +
Expand Down