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. --- examples/headers/README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 examples/headers/README.md (limited to 'examples/headers/README.md') diff --git a/examples/headers/README.md b/examples/headers/README.md new file mode 100644 index 0000000..01c243a --- /dev/null +++ b/examples/headers/README.md @@ -0,0 +1,16 @@ +# HTTP headers example + +This example shows a HTTP/1.1 server that listens to port `8080` and prints +the headers received from the client (up to a maximum of `max_headers`) to +standard output. + +## How to build + +If using `make(1)`, just run `make` from this directory. + +If using CMake, examples are built by default when configuring the project +from [the top-level `CMakeLists.txt`](../../CMakeLists.txt). + +## How to run + +Run the executable without any command line arguments. -- cgit v1.2.3