tiny_httpd/tests/unit
Simon Cruanes ba19880d75
Some checks failed
github pages / deploy (push) Has been cancelled
build / build (4.13.x, ubuntu-latest) (push) Has been cancelled
build / build (4.14.x, ubuntu-latest) (push) Has been cancelled
build / build (5.03.x, ubuntu-latest) (push) Has been cancelled
hardening bugfixes
* fix: use realpath to validate filesystem paths against traversal

- add string_prefix helper to check path containment
- compute root_canonical once per add_vfs_ call
- use realpath only for filesystem (on_fs=true), keeping simple
  contains_dot_dot check for VFS
- paths are already URL-decoded by Route.rest_of_path_urlencoded

* fix: add header size limits to prevent memory exhaustion

add optional limits to Headers.parse_:
- max_headers: 100 (default)
- max_header_size: 16KiB per header (default)
- max_total_size: 256KiB total (default)

returns 431 status code when limits exceeded per RFC 6585.
2026-02-10 19:57:21 -05:00
..
util format 2024-08-15 09:18:15 -04:00
ws format 2024-08-15 09:18:15 -04:00
dune hardening bugfixes 2026-02-10 19:57:21 -05:00
t_buf.ml wip: bugfixes 2024-02-26 16:28:31 -05:00
t_headers.ml hardening bugfixes 2026-02-10 19:57:21 -05:00
t_io.ml add more tests 2024-06-18 17:04:15 -04:00
t_response.ml add basic test for response 2025-04-18 09:37:27 -04:00
t_server.ml details for logs 2024-02-26 22:54:45 -05:00
t_util.ml fix percent encoding for < 0x10 chars 2024-12-25 11:12:42 -05:00