Comments (9)
Note: I'm happy to do the PR to implement this, just not sure what the API should work/look like :)
from hood.
Hmmm yea. The only difference is the header, correct? If so, this can currently be done by providing a headers
array of Report-Only header. However, that's no fun.
I see in the docs you can also include multiple Report-Only headers.
So, what if it were simply a boolean on the object. If you want a normal policy and a report-only policy, call csp twice?
app.use(hood.csp({
policy: {
'default-src': ['self', 'unsafe-inline']
}
});
app.use(hood.csp({
policy: {
'default-src': 'self'
},
reportOnly: true
});
// shortcut could include a 2nd boolean argument?
hood.csp(policyStr, isReportOnly);
I can implement this pretty quickly today.
from hood.
Ahhh, that's pretty clever. Yeah, I think that'd work great!
from hood.
alright, added that. will publish v0.2.0 today.
from hood.
Beautiful, thanks!
Question about the patch; is there a reason to not send the corresponding X-Content-Security-Policy-Report-Only
and X-Webkit-CSP-Report-Only
headers?
from hood.
Ah, I didn't notice them when looking at the docs, so I just assumed Report-Only emerged once the X- had been dropped. Are the X- versions useful as well?
from hood.
It'd be nice to be able to test policies before turning them on in production, and Report-Only is definitely the best way to do that. Safari only supports the X-Webkit-CSP header and Firefox < v23 is still 10% of visits to webmaker.org.
I think that so long as the default for hood to send the standard and non-standard policy headers, it should also send the standard and non-standard report-only headers.
That being said, let me install an older version of Firefox and make sure that the non-standard report-only headers work properly :)
from hood.
ok, i'll add them in
from hood.
done, in v0.2.1!
from hood.
Related Issues (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 hood.