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. --- doc/man7/libweb_handler.7 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'doc/man7/libweb_handler.7') diff --git a/doc/man7/libweb_handler.7 b/doc/man7/libweb_handler.7 index 5c910e0..b9fd53f 100644 --- a/doc/man7/libweb_handler.7 +++ b/doc/man7/libweb_handler.7 @@ -1,4 +1,4 @@ -.TH LIBWEB_HANDLER 7 2023-09-15 0.1.0 "libweb Library Reference" +.TH LIBWEB_HANDLER 7 2023-11-18 0.2.0 "libweb Library Reference" .SH NAME libweb_handler \- libweb high-level website configuration @@ -69,15 +69,17 @@ struct handler_cfg const char *\fItmpdir\fP; int (*\fIlength\fP)(unsigned long long len, const struct http_cookie *c, struct http_response *r, void *user); void *\fIuser\fP; + size_t \fImax_headers\fP; }; .EE .in .PP .IR tmpdir , -.I length -and +.IR length , .I user +and +.I max_headers are passed directly to the .I struct http_cfg object used to initialize a -- cgit v1.2.3