Giter Site home page Giter Site logo

csp's People

Contributors

bendingbender avatar danielkorte avatar dependabot[bot] avatar donmahallem avatar fauxfaux avatar frux avatar hcodes avatar i-akhmadullin avatar joshuan avatar nikshel avatar savjee avatar sergets avatar thisislawatts avatar vaseker avatar xkr47 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

csp's Issues

License

Hi!

Can you specify license for code in repo and npm packages?

Add new CSP constants

For example we needed 'wasm-unsafe-eval' and it was sad we couldn't just include it from the lib.

Combining 'none' and other source expressions errors in Chrome

If we create a preset from policies, a directive might get both the 'none' and other source values.

console.log(
  getCSP({
    presets: {
      default: {
        'connect-src': [NONE],
      },
      api: {
        'connect-src': ['https://api.example.net'],
      },
    },
  })
);

This example yields the following CSP:

connect-src 'none' https://api.example.net;

If we include this in a web page, Google Chrome will give the following error:

The Content-Security-Policy directive ‘connect-src’ contains the keyword ‘none’ alongside with other source expressions. The keyword ‘none’ must be the only source expression in the directive value, otherwise it is ignored.

While this works as expected, we can connect to the API successfully, it could be nice if this plugin filters out the 'none' value if other values are present.

The "expected" output (at least according to Google Chrome) for this CSP would be:

connect-src https://api.example.net;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.