Skip to main content

shadow_mode_enabled

Function shadow_mode_enabled 

Source
pub fn shadow_mode_enabled() -> bool
Expand description

Issue #79 round 14 — Srikanth’s shadow-mode ask. When enabled, the server returns 200 for requests that would otherwise be rejected (unknown paths → 404, spec violations → 400/422) while still recording them to the unknown-paths / conformance buffers. Lets a proxy replay run flow through non-blocking with full violation capture — a “report-only” / monitor mode.

Read once per request from MOCKFORGE_SHADOW_MODE (1/true). Cheap enough for the hot path; no caching needed since env lookups are fast and this keeps the flag dynamically toggleable in tests.