Skip to main content

baseline_headers

Function baseline_headers 

Source
pub fn baseline_headers() -> [(&'static str, String); 5]
Expand description

Baseline header set emitted by every target.

Order matters: emitters render headers in iteration order so the resulting files are deterministic across rebuilds (golden-test friendly). The five baseline keys are:

  1. Strict-Transport-Security — 2-year max-age, preload-ready
  2. Content-Security-Policy — sourced from crate::csp::computed_policy
  3. X-Content-Type-Options — nosniff
  4. Referrer-Policy — strict-origin-when-cross-origin
  5. Permissions-Policy — camera/geolocation/microphone off

§Examples

use ssg::postprocess::edge_headers::baseline_headers;
let baseline = baseline_headers();
assert_eq!(baseline.len(), 5);
assert_eq!(baseline[0].0, "Strict-Transport-Security");