Let's now use http_trailers_to_htx() instead of htx_add_all_trailers()
to parse HTTP/1 trailers. Upper case is permitted and thats the only
difference with H2/H3 for now.
The parser is stricter than the previous function, so the following
names are now rejected as it is for other versions:
"host", "content-length", "connection", "proxy-connection"
"keep-alive", "upgrade", "te", "transfer-encoding"
{
struct http_hdr hdrs[global.tune.max_http_hdr];
struct h1m tlr_h1m;
+ uint parser_flags;
int ret = 0;
if (b_data(srcbuf) == ofs) {
goto output_full;
}
- if (!htx_add_all_trailers(dsthtx, hdrs))
+ parser_flags = HTTP_PF_UPCASE_OK;
+ parser_flags |= (h1m->flags & H1_MF_RESP) ? HTTP_PF_DIR_RES : 0;
+
+ if (http_trailers_to_htx(hdrs, dsthtx, parser_flags) != HTTP_PRS_SUCCESS)
goto error;
h1m->state = H1_MSG_DONE;