HTTP parser does not properly strip spaces and tabs from the beginnings of header values
Author: kenballusCreated Jul 17, 2024Updated Aug 7, 2026
Labelsprio:accepting-patches
The HTTP RFCs specify that header values may be optionally prefixed and/or suffixed with any number of spaces and/or tabs, and that these are to be ignored. Libevent implements this correctly for suffixes, but not for prefixes.
For example, if you send the following request to libevent:
GET / HTTP/1.1\r\n
Host: whatever\r\n
Test: \t abc \t \r\n
\r\n...it sees a Test header value of \t abc, but it should see abc.
Source: libevent/libevent