frux / csp-header Goto Github PK
View Code? Open in Web Editor NEWcsp-header moved to monorepo https://github.com/frux/csp
Home Page: https://github.com/frux/csp
csp-header moved to monorepo https://github.com/frux/csp
Home Page: https://github.com/frux/csp
export const generateNonce = (): string => randomBytes(16).toString('base64');
Can you please show an example how to add referer policies to the CSP? I don't get it to work.
// referer values
export const NO_REFERER = "'no-referer'";
export const NONE_WHEN_DOWNGRADE = "'none-when-downgrade'";
export const ORIGIN = "'origin'";
export const ORIGIN_WHEN_CROSS_ORIGIN = "'origin-when-cross-origin'";
export const UNSAFE_URL = "'unsafe-url'";
Thanks
Hello,
When using this library, I found that cps.INLINE constant would work, but 'unsafe-inline' would not. I mention this because when trying to use 'sha256-ASTASFGA23SDGA23' as a string constant, this also does not work. Obviously we can't have const for all sha #.
Was wondering if there was a quick fix for this?
Thanks
Can you please extend the library to support the (newer?) *-elem policies?
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
Thanks
In 2.0 The following doesn't work anymore:
{
directives: {
// ...
"connect-src": ["'self'", oidcAuthorityUrl, "https://translation.googleapis.com"],
// ...
}
}
because the rules are string-joined with a ",".
.. instead I have to use "connect-src": [`'self' ${oidcAuthority} https://translation.googleapis.com`],
(note the spaces).
Is this change on purpose?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.