Strict CSP(Content-Security Policy) with nonce method not working Angular V18.1 Build Chunk...

Discussão em 'Angular' iniciado por Solairaj S, Fevereiro 16, 2025.

  1. Solairaj S

    Solairaj S Guest

    I tried all the prod configuration in angular files also. it's not working "optimization": true, "sourceMap": false, "outputHashing": "all", "namedChunks":false

    Chunk files error (https://i.sstatic.net/YjRZ9YVx.png)

    soltuion with strict csp policy without applying the inline

    I'm Working as a full stack of Angular + django stack

    As per VA they are recommending to implement a strict CSP Policy.

    The below policy is blocking that angular build files

    CSP_DEFAULT_SRC = ("'self'",)
    CSP_SCRIPT_SRC = ("'self'","'nonce-rAnd0m'")
    CSP_STYLE_SRC = ("'self'","'nonce-rAnd0m'",)
    CSP_PRELOAD_SRC = ("'self'","'nonce-rAnd0m'")
    CSP_IMG_SRC = ("'self'", "data:")
    CSP_FONT_SRC = ("'self'",)

    Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' 'nonce-rAnd0m'". Either the 'unsafe-inline' keyword, a hash ('sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='), or a nonce ('nonce-...') is required to enable inline execution.

    This error is showing

    Continue reading...

Compartilhe esta Página