Technical Reference: HAR 1.2 Sanitization & Latency Decomposition
Browser Developer Tools export network diagnostics in the W3C HTTP Archive (HAR 1.2) JSON schema. While HAR captures are invaluable for reproducing gateway timeouts, TLS handshake delays, and CORS failures, raw exports embed live authentication state: session cookies, OAuth2 Bearer tokens, CSRF nonces, signed S3 URLs, and API keys inside query parameters. Sharing an unsanitized HAR file inside a public issue tracker or vendor support portal is equivalent to handing over an active authenticated browser session.
1. Multi-Surface Credential Stripping Across HAR 1.2
Credentials leak across five distinct nodes in the HAR object graph, and scrubbing only headers leaves tokens exposed elsewhere. The ZERO.OPS HAR Sanitizer performs a deterministic traversal over every element of log.entries[]:
- Request and Response Headers: Case-insensitive matching against
Cookie,Set-Cookie,Authorization,Proxy-Authorization,X-Api-Key,X-Auth-Token,X-Csrf-Token, and user-supplied headers. - Structured Cookie Arrays: Browser exporters duplicate cookies into dedicated
request.cookies[]andresponse.cookies[]arrays; every cookie object value is overwritten. - Dual Query Parameter Scrubbing: Sensitive keys such as
access_token,api_key,sig,jwt, andcodeare redacted both insiderequest.queryString[]and directly inside the rawrequest.urlstring while preserving non-secret pagination parameters. - POST Payload Inspection: Form parameters and JSON request bodies are recursively walked to redact password, secret, and token fields without altering payload schema shape.
2. HTTP Timing Phase Decomposition Formula
Each HAR entry records granular millisecond durations inside entry.timings. Unavailable phases in the HAR 1.2 specification are encoded as -1 and clamped to zero during aggregation. Total request elapsed time decomposes into seven sequential network and server phases:
In the generated SVG waterfall, network setup overhead (T_blocked + T_dns + T_connect + T_ssl + T_send) is rendered in neutral slate, server processing Time-To-First-Byte (T_wait) in high-contrast orange, and response payload download (T_receive) in cyan. This visual separation immediately reveals whether latency stems from cold TCP/TLS handshakes or upstream backend compute bottlenecks.
3. Nearest-Rank Latency Percentiles (P50, P95, P99)
Arithmetic means hide tail-latency spikes caused by cold starts, connection pool saturation, or upstream gateway 504 timeouts. After sorting all N entry durations in ascending order d_0 <= d_1 <= ... <= d_{N-1}, the analyzer computes exact nearest-rank percentiles:
Evaluating P50 (median) alongside P95 and P99 immediately distinguishes systemic backend slowdowns from isolated single-request stalls. When P50 remains under 80 ms while P95 exceeds 800 ms, engineers can inspect the top rows of the sorted latency table to pinpoint which API route experienced lock contention or cold TLS negotiation.
4. Payload Size Aggregation & Transfer Bottleneck Attribution
Beyond server wait time, oversized unoptimized JSON responses and uncompressed JavaScript bundles degrade perceived application responsiveness over mobile or cross-region links. For every entry in the HAR archive, the analyzer aggregates response.bodySize (falling back to response.content.size when transfer size headers are omitted by proxy exporters) alongside HTTP status codes. Grouping 4xx client authorization errors and 5xx upstream gateway timeouts separately from 200 OK payloads lets teams verify whether a slow endpoint failed fast or blocked worker threads until hitting a load-balancer timeout threshold.
5. Immutable Cloning & Redaction Mode Trade-offs
Choosing between replacing header values with [REDACTED] and removing sensitive headers entirely depends on the downstream diagnostic consumer. Keeping header names intact with [REDACTED] preserves structural proof that the browser actually transmitted an Authorization or Cookie header (which is essential when debugging CORS preflight or SSO cookie-domain mismatches), whereas stripping headers entirely minimizes file size and eliminates structural fingerprinting. Because every transformation operates on an immutable structured clone inside browser RAM, your raw session artifacts never cross the network boundary while support teams receive a diagnostic-complete, audit-safe trace file.