We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Security Header Middleware

Security headers let a server tell the browser which behavior to permit, but they're easy to configure inconsistently. Bearly Secure already has separate middleware for several policies. One focused middleware keeps the complete browser-security baseline together without adding a dependency just to set headers.

Add the Remaining Baseline

The existing CSP, nonce, framing, referrer, and nosniff policies need to remain intact. The consolidated middleware also adds narrow defaults:

A sandboxed iframe without allow-same-origin has an opaque origin. The global same-origin resource policy would therefore block the shipping widget's own stylesheet and script. Override it only on those two public assets.

Transport policy remains separate. A local HTTP app should not send Strict-Transport-Security or CSP's upgrade-insecure-requests directive.

Assignment

Bearly Secure's browser policies are split across middleware. Consolidate them and add the remaining header baseline without changing existing behavior.

With Bearly Secure still running, run and submit the CLI tests from the project root.