Skip to content

fix(nginx): allow Angular lazy-CSS inline handler in CSP#46

Merged
dancodingbr merged 1 commit into
mainfrom
fix/security-improvements
May 6, 2026
Merged

fix(nginx): allow Angular lazy-CSS inline handler in CSP#46
dancodingbr merged 1 commit into
mainfrom
fix/security-improvements

Conversation

@dancodingbr
Copy link
Copy Markdown
Owner

Angular's production build emits for non-render-blocking stylesheet loading. This inline event handler is blocked by script-src 'self'. Adding 'unsafe-hashes' together with the SHA-256 hash of the exact string 'this.media='''all'''' permits only this specific known handler without opening unsafe-inline.

Angular's production build emits <link onload="this.media='all'"> for
non-render-blocking stylesheet loading. This inline event handler is
blocked by script-src 'self'. Adding 'unsafe-hashes' together with the
SHA-256 hash of the exact string 'this.media='\''all'\''' permits only
this specific known handler without opening unsafe-inline.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dancodingbr dancodingbr merged commit b950b4c into main May 6, 2026
23 of 36 checks passed
@dancodingbr dancodingbr deleted the fix/security-improvements branch May 6, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant