Comments (11)
I agree. I've also thought about a version of this module that does no browser sniffing; is that something you'd want?
from csp.
I'm a fan of the entire helmet suite, so I'd be uninterested in a second library. I would, however be happy to send a PR if the maintainers would consider it.
from csp.
The API change I would make would be a new option, setLegacyHeaders
which supports three values:
"auto"
- the current default behavior- any other truthy value - equivalent of
setAllHeaders: true
- any defined falsey value - only sets the standard header
The default value would be derived from the setAllHeaders config for backwards compatibility, and setAllHeaders would become deprecated.
from csp.
Ah, sorry—I didn't mean to suggest I'd make another library.
What about this?
// Current default behavior (these are all equivalent)
csp({})
csp({ setLegacyHeaders: true })
csp({ setAllHeaders: false })
// Always set all headers
csp({ setAllHeaders: true })
// Don't set legacy headers; do no browser sniffing
csp({ setLegacyHeaders: false })
// This throws an error
csp({
setAllHeaders: true,
setLegacyHeaders: false
})
from csp.
Looks good to me.
from csp.
Would you be interested in making a pull request?
from csp.
Sure, I'll give it a shot.
from csp.
I took bits and pieces of what you did, committed it with you as the author, and added you as a contributor in the package.json
. I decided to go with an API of browserSniff: false
which eschews all useragent sniffing.
This is released in [email protected]
and [email protected]
.
Thanks for your help!
from csp.
@ry7n I'm making a new website for Helmet.js and I want to credit everyone who's contributed. Do you have a name and/or website you'd like me to use to credit you?
from csp.
Thanks! You can use the name and URL on my Github profile.
from csp.
Added you to the list! Stay tuned for the new Helmet documentation website.
from csp.
Related Issues (20)
- Add support for trusted-types HOT 7
- No CSP headers for iOS WebViews HOT 5
- how to choose? With helmet or helmet-csp? It's all yours, I don't know which one to choose? HOT 2
- Cannot Use Function Instead of Array as Value of Directive HOT 8
- safari will ignore whole rule HOT 4
- Convert module to TypeScript HOT 1
- reportTo directive HOT 4
- Upgrade dependency for platorm to version > 1.3.5 HOT 4
- How to add a specific sha256 to scriptSrc? HOT 4
- 'unsafe-inline' should be allowed in style-src and connect-src HOT 1
- Issue due to extra x-content-security-policy, x-webkit-csp headers HOT 4
- Add support for script-src-elem directive HOT 3
- Unable to use with Webpack when targeting Node HOT 18
- TypeScript typings are broken HOT 3
- Header require-sri-for deprecated HOT 7
- Header report-uri deprecated HOT 4
- res.setHeader is not a function HOT 5
- Bowser.getParser is not a function HOT 9
- Remove browser sniffing HOT 6
- object-src directive checker error HOT 2
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 csp.