Skip to content

fix: support new cfL4 Server-Timing header format#294

Merged
code-inflation merged 3 commits intocode-inflation:masterfrom
danielj:fix/latency-header-parsing
Apr 4, 2026
Merged

fix: support new cfL4 Server-Timing header format#294
code-inflation merged 3 commits intocode-inflation:masterfrom
danielj:fix/latency-header-parsing

Conversation

@danielj
Copy link
Copy Markdown

@danielj danielj commented Apr 4, 2026

Fixes #286, refs #288.

Cloudflare changed the Server-Timing header from cfRequestDuration;dur=<ms> to cfL4;desc="?proto=TCP&rtt=<us>&...", which panics the latency test. This adds a fallback parser for the new format and replaces the unwrap chain with graceful error handling. Falls back to raw round-trip time if neither format matches. Request failures are skipped rather than counted as 0.0.

Public API unchanged (test_latency() -> f64). Removed dead WARNED_NEGATIVE_LATENCY static. 9 new tests.

@code-inflation
Copy link
Copy Markdown
Owner

thanks for your contribution

@code-inflation code-inflation merged commit dee3067 into code-inflation:master Apr 4, 2026
6 checks passed
@danielj
Copy link
Copy Markdown
Author

danielj commented Apr 4, 2026 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linux build failed to run

2 participants