From ff3493f08f35e907620bc9d56ba202d7e1300a68 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Tue, 5 Jan 2021 14:32:50 +0100 Subject: [PATCH 1/1] sed(): Don't call enforce_header_order() if a filter removed the request line ... as enforce_header_order() asserts that the request line is present. Without the request line the request will be rejected as invalid later on anyway, so sorting the headers first is pointless. --- parsers.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parsers.c b/parsers.c index d63647d8..ba151d15 100644 --- a/parsers.c +++ b/parsers.c @@ -1291,7 +1291,9 @@ jb_err sed(struct client_state *csp, int filter_server_headers) f++; } - if (!filter_server_headers && !list_is_empty(csp->config->ordered_client_headers)) + if (!filter_server_headers && + !list_is_empty(csp->config->ordered_client_headers) && + csp->headers->first->str != NULL) { enforce_header_order(csp->headers, csp->config->ordered_client_headers); } -- 2.39.2