HTTP Header Parser
How it works
Each non-blank line is matched against Name: value. A line beginning with
whitespace is treated as a continuation of the header above it rather than a header of its
own. Anything else — a request line, a status line, stray text — is counted as a skipped
line instead of causing an error, since real-world header dumps are rarely clean copies.
Header names are compared case-insensitively when checking for repeats, matching how HTTP
itself treats header names.
Frequently asked questions
How are folded (continuation) header lines handled?
A line that starts with a space or tab is treated as a continuation of the header directly above it, and its trimmed text is appended to that header's value with a single space — the obsolete line-folding style from RFC 822 that some servers and proxies still emit.
Why are malformed lines skipped instead of raising an error?
A pasted header dump is rarely just headers — it often carries a leading request line like "GET / HTTP/1.1", a blank separator, or other stray text copied along with it. None of that means the paste is unusable, so a line that is not shaped like a header is simply counted as skipped rather than failing the whole parse.
Is a header appearing more than once necessarily a mistake?
No — some headers are meant to repeat. Set-Cookie is the classic example: a response setting several cookies sends one Set-Cookie line per cookie. This tool flags repeated names so you notice them, not because a repeat is inherently wrong.