config/initializers/secure_headers.rb
Within %w
/%W
, quotes and ',' are unnecessary and may be unwanted in the resulting strings. Open
Open
style_src: %w[
'unsafe-inline'
'self'
fonts.googleapis.com
www.gstatic.com
- Read upRead up
- Exclude checks
This cop checks for quotes and commas in %w, e.g. %w('foo', "bar")
It is more likely that the additional characters are unintended (for example, mistranslating an array of literals to percent string notation) rather than meant to be part of the resulting strings.
Example:
# bad
%w('foo', "bar")
Example:
# good
%w(foo bar)
Within %w
/%W
, quotes and ',' are unnecessary and may be unwanted in the resulting strings. Open
Open
script_src: %w[
'unsafe-inline'
'self'
d2wy8f7a9ursnm.cloudfront.net
www.google-analytics.com
- Read upRead up
- Exclude checks
This cop checks for quotes and commas in %w, e.g. %w('foo', "bar")
It is more likely that the additional characters are unintended (for example, mistranslating an array of literals to percent string notation) rather than meant to be part of the resulting strings.
Example:
# bad
%w('foo', "bar")
Example:
# good
%w(foo bar)