mirror of https://github.com/OISF/suricata
htp: keep trailer fields out of the header table
Trailer fields of a chunked message are parsed by the same code as header fields and were appended to the header table, where a name already used in the header section is combined into the existing value. So a header keyword silently gained trailer data, and a chunked request ending in "User-Agent: x" reported its user agent as "Mozilla, x". Store them in a separate table per direction instead. Repeated names are still combined and the field count limit still applies across both sections, but the Content-Length bookkeeping is skipped: trailer fields take no part in framing. The C API gains htp_tx_request_trailers() and htp_tx_response_trailers(); every existing getter keeps returning the header section only. A few HTTP unit tests assert the old guarantee that trailer content is reachable through http_header, so they fail from here until the commit that adds the trailer buffers converts them. Every commit in the series still builds. Ticket: #8256.pull/16485/head
parent
4ceb0e7a52
commit
a0b518b9d6
@ -0,0 +1,84 @@
|
||||
>>>
|
||||
POST / HTTP/1.1
|
||||
Host: x
|
||||
Transfer-Encoding: chunked
|
||||
|
||||
1
|
||||
x
|
||||
0
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
|
||||
|
||||
<<<
|
||||
HTTP/1.1 200 OK
|
||||
Content-Length: 0
|
||||
|
||||
@ -0,0 +1,84 @@
|
||||
>>>
|
||||
GET / HTTP/1.1
|
||||
Host: x
|
||||
|
||||
|
||||
<<<
|
||||
HTTP/1.1 200 OK
|
||||
Transfer-Encoding: chunked
|
||||
|
||||
1
|
||||
x
|
||||
0
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
|
||||
|
||||
Loading…
Reference in New Issue