From 65031ca3502e0c27780be847fd97c112546741a9 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Sat, 18 Nov 2023 00:56:04 +0100 Subject: Send HTTP headers to payload callback Even if libweb already parses some common headers, such as Content-Length, some users might find it interesting to inspect which headers were received from a request. Since HTTP/1.1 does not define a limit on the number of maximum headers a client can send, for security reasons a maximum value must be provided by the user. Any extra headers shall be then discarded by libweb. An example application showing this new feature is also provided. --- handler.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'handler.c') diff --git a/handler.c b/handler.c index 61a2806..f6e47a3 100644 --- a/handler.c +++ b/handler.c @@ -109,7 +109,8 @@ static struct client *find_or_alloc_client(struct handler *const h, .payload = on_payload, .length = on_length, .user = ret, - .tmpdir = h->cfg.tmpdir + .tmpdir = h->cfg.tmpdir, + .max_headers = h->cfg.max_headers }; *ret = (const struct client) -- cgit v1.2.3