Express/Connect middleware to set the Referrer-Policy HTTP header, part of the Helmet.js security suite. Version 1.2.0 is stable and works with Node >=4. Ships TypeScript definitions. Allows specifying one of the standard policy values (e.g., no-referrer, same-origin, strict-origin-when-cross-origin) or an array of policies for fallback. Lightweight and focused, with no external dependencies.
npm install referrer-policyVerified import paths — ran on the pinned version, not inferred.
Shows how to import and use the middleware with Express, setting the policy to 'same-origin'.
Pass a single policy string unless you intend fallback behavior (array).
Always validate policy against the allowed values listed in the spec.
Explicitly set policy to avoid ambiguity.
Run 'npm install referrer-policy' and ensure import path matches package name.
Use 'import referrerPolicy from 'referrer-policy''.
Use one of the valid policies: 'no-referrer', 'no-referrer-when-downgrade', 'same-origin', 'origin', 'strict-origin', 'origin-when-cross-origin', 'strict-origin-when-cross-origin', 'unsafe-url'.
No dependency data recorded yet.