Comments (3)
Hello @VikasKumar190, what do your CSP headers look like? The configuration suggests you're setting both CSP and CSP-Report-Only headers. The CSP header from your configuration would be content-security-policy: default-src 'self'; script-src 'self'
which would prevent you from loading assets from bootstrapcdn.com
.
from secure_headers.
I had this problem and found you'll have to adjust your code to the following:
SecureHeaders::Configuration.default do |config|
config.csp = SecureHeaders::OPT_OUT
config.csp_report_only = {
default_src: %w('self'),
script_src: %w('self')
}
end
Otherwise it applies both headers if you look at your network tab, the opt out call explicitly tells the gem to not add the header.
from secure_headers.
Ah, that's right. We apply CSP by default. The code should probably account for this, but it's an easy enough workaround. Thanks @ryanseddon
from secure_headers.
Related Issues (20)
- Setting SameSite cookie attribute conditionally HOT 4
- Guide for transitioning from secure_headers to vanilla rails csp HOT 3
- Incorrect Version as latest release HOT 1
- nonced tag helpers including nonce directive in csp has potential to break applications HOT 17
- Add support for CSP level 3 HOT 3
- Add require-trusted-types-for to CSP HOT 3
- Support CSP "double policies"
- Major Version 7.0.0 HOT 1
- Set `default-src` CSP Attribute to `none` by default HOT 1
- URI::InvalidURIError: Invalid data URI HOT 1
- Installation instructions unclear HOT 1
- jekyll integration HOT 3
- How can I disable 'unsafe-inline' from script-src? HOT 1
- test issue
- test issue
- `content_security_policy_nonce` calls Rails method so CSP does not contain nonce
- CSP Report-uri deprecated, replaced by report-to
- RubyGems doesn't have latest version of this gem HOT 1
- SecureHeaders middleware erases all cookies in Rack 3 due to \n joining HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from secure_headers.