• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

twitter / secureheaders / 1167
97%

Build:
DEFAULT BRANCH: master
Ran 25 Mar 2018 11:48PM UTC
Jobs 5
Files 37
Run time 9min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
1167

Pull #389

travis-ci

web-flow
Avoid calling content_security_policy_nonce internally

Rails 5.2 adds support for configuring a Content-Security-Policy header,
including adding nonces to tags produced by the `javascript_tag` helper.

Unfortunately, Rails and this gem now both define a helper named
`content_security_policy_nonce`:

https://github.com/rails/rails/blob/v5.2.0.rc2/actionpack/lib/action_controller/metal/content_security_policy.rb#L44
https://github.com/twitter/secureheaders/blob/v5.0.5/lib/secure_headers/view_helper.rb#L69

The Rails helper wins over the Secure Headers one, and helpers like
`nonced_javascript_tag` currently raise this error on Rails 5.2:

    ArgumentError: wrong number of arguments (given 1, expected 0)

By using a method with a different name internally, we avoid clashing
with the Rails implementation, and `nonced_javascript_tag` works again.
Pull Request #389: Avoid calling content_security_policy_nonce internally

25 of 25 new or added lines in 2 files covered. (100.0%)

2070 of 2138 relevant lines covered (96.82%)

216.15 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
100.0
spec/lib/secure_headers/view_helpers_spec.rb
Jobs
ID Job ID Ran Files Coverage
1 1167.1 (2.5.0, SUITE=rspec spec) 25 Mar 2018 11:48PM UTC 0
97.68
Travis Job 1167.1
3 1167.3 (2.4.3, SUITE=rspec spec) 25 Mar 2018 11:50PM UTC 0
97.68
Travis Job 1167.3
5 1167.5 (2.3.6, SUITE=rspec spec) 25 Mar 2018 11:51PM UTC 0
97.68
Travis Job 1167.5
7 1167.7 (2.2.9, SUITE=rspec spec) 25 Mar 2018 11:52PM UTC 0
97.68
Travis Job 1167.7
11 1167.11 (jruby-head, SUITE=rspec spec) 25 Mar 2018 11:58PM UTC 0
0.0
Travis Job 1167.11
Source Files on build 1167
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #1167
  • Pull Request #389
  • PR Base - master (#1166)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc