Commit graph

584 commits

Author SHA1 Message Date
Simon Cruanes
12f762eb6e Bump minimum OCaml version to 4.13 for Unix.realpath support 2026-02-10 23:36:55 +00:00
Simon Cruanes
a25e24ed8c
CI: check format 2026-02-09 22:38:21 -05:00
Simon Cruanes
4512eb137a
format 2026-02-09 22:36:58 -05:00
Simon Cruanes
2742a4715a
fix bug 2026-02-09 22:36:20 -05:00
Simon Cruanes
b87226d1be
Merge branch 'main' into simon/various-fixes 2026-02-08 23:30:41 -05:00
Simon Cruanes
9003a13da0 chore: reduce max_total_size to 256KB (from 1MB) 2026-02-09 04:21:52 +00:00
Simon Cruanes
b0586708a7 fix: remove unused open in test 2026-02-09 04:18:11 +00:00
Simon Cruanes
d19c461e61 test: add test for header size limit enforcement 2026-02-09 04:11:46 +00:00
Simon Cruanes
1f357e495a fix: add header size limits to prevent memory exhaustion
Add optional limits to Headers.parse_:
- max_headers: 100 (default)
- max_header_size: 16KB per header (default)
- max_total_size: 1MB total (default)

Returns 431 status code when limits exceeded per RFC 6585.
2026-02-09 04:07:19 +00:00
Simon Cruanes
8050fb1f05 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
2026-02-09 03:48:42 +00:00
Simon Cruanes
37ba54a4d6 doc 2026-02-09 03:38:38 +00:00
Simon Cruanes
8a8aadfbb0
doc
Some checks failed
github pages / deploy (push) Has been cancelled
build / build (4.08.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
2025-06-24 21:13:18 -04:00
Simon Cruanes
9a1343aef7
remove global withlock builder, pass it as argument instead
Some checks failed
github pages / deploy (push) Has been cancelled
build / build (4.08.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
2025-06-23 10:08:07 -04:00
Simon Cruanes
f10992ec32
feat WS: abstraction for critical section
Some checks failed
github pages / deploy (push) Has been cancelled
build / build (4.08.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
can be replaced with a proper cooperative lock
2025-06-20 18:03:40 -04:00
Simon Cruanes
0f917ddf72
format
Some checks failed
github pages / deploy (push) Has been cancelled
build / build (4.08.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
2025-06-06 22:25:48 -04:00
Simon Cruanes
03c3e09f12
feat route: add to_url, to produce a URL path from a route
provide arguments and get the corresponding path, which makes
it easy to build a full URL if needed.
2025-06-06 22:25:01 -04:00
Simon Cruanes
023805232f
fix warnings in C stubs 2025-06-06 22:24:52 -04:00
Simon Cruanes
022a495de3
fix warnings 2025-06-06 22:24:39 -04:00
Simon Cruanes
6203e7a4a7
prepare for 0.19
Some checks failed
github pages / deploy (push) Has been cancelled
build / build (4.08.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
2025-04-18 09:37:27 -04:00
Simon Cruanes
d7a5cca1d4
feat(headers): set will not reallocate whole list if not needed 2025-04-18 09:37:27 -04:00
Simon Cruanes
cdac33689a
add basic test for response 2025-04-18 09:37:27 -04:00
Simon Cruanes
4c8cc8ba5a
test: update test 2025-04-18 09:37:27 -04:00
Simon Cruanes
173e5fef6e
feat(headers): use case insensitive comparison 2025-04-18 09:37:27 -04:00
Simon Cruanes
94c9239d64
fix(response): do not override "content-length" in raw response
close #92
2025-04-18 09:37:27 -04:00
Simon Cruanes
c55e3a2dfc
feat pool: expose acquire/release 2025-04-18 09:37:27 -04:00
Simon Cruanes
f6daff24c0
prepare for 0.18 2025-04-18 09:37:27 -04:00
Simon Cruanes
3c9e505a45
fix test 2025-04-18 09:37:27 -04:00
Simon Cruanes
44002fc355
detail 2025-03-25 15:01:17 -04:00
Simon Cruanes
f3461cfd21
detail in example 2025-03-21 08:37:16 -04:00
Simon Cruanes
075ad0825a
feat: add ?head_middlewares to create 2025-03-19 13:40:49 -04:00
Simon Cruanes
75d90559bd
fix warnings 2025-03-19 13:39:15 -04:00
Simon Cruanes
e177153f10
remove dead comment 2025-03-14 11:12:11 -04:00
Jonah Beckford
1e0bbc7f39 Processing to fix incompatible -O and gcc flags
Some checks failed
github pages / deploy (push) Has been cancelled
build / build (4.08.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
Two changes:
1. Accept BUILD_TINY_HTTPD_OPTLEVEL envvar to adjust the -O<num> level. Defaults to 2. Can be negative to remove it entirely, which fixes errors with MSVC which will bail on incompatible options.
2. Do not use -fPIC with MSVC
2025-02-15 20:06:44 -05:00
Simon Cruanes
1f60d6165d
add content-type header for prometheus endpoint
Some checks failed
github pages / deploy (push) Has been cancelled
build / build (4.08.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
2025-02-10 20:38:04 -05:00
Simon Cruanes
55eb9c2a2f
fix CI
Some checks failed
build / build (4.08.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
github pages / deploy (push) Has been cancelled
2025-01-29 22:29:38 -05:00
Simon Cruanes
92999d56e8
typo 2025-01-29 22:25:22 -05:00
Simon Cruanes
09ff4f98ed
fix percent encoding for < 0x10 chars 2024-12-25 11:12:42 -05:00
Simon Cruanes
a86eac85bf
add a HEAD endpoint to echo 2024-12-25 10:59:32 -05:00
Simon Cruanes
1318d46efa
fix percent encoding on control chars 2024-12-06 14:42:17 -05:00
Simon Cruanes
1c61c39172
new flag ?enable_logging to disable regular logs (not debug) 2024-12-04 15:52:32 -05:00
Simon Cruanes
7639acfc19
perf: force a lazy in the branch where it is used 2024-12-04 15:10:57 -05:00
Simon Cruanes
709d1106fa
Merge pull request #93 from c-cube/simon/multipart-form
library for multipart form data handling
2024-12-03 10:22:58 -05:00
Simon Cruanes
731dd7de51
add a form to echo.ml for manual testing 2024-12-03 10:13:33 -05:00
Simon Cruanes
9875543192
remove debug line 2024-12-03 09:44:16 -05:00
Simon Cruanes
21c0f7f25d
feat: require \r\n before all boundaries but the first 2024-12-02 15:58:16 -05:00
Simon Cruanes
099777b593
test 2024-12-02 15:49:08 -05:00
Simon Cruanes
0b34c966f7
fix multipart: no \r\n before boundary after all 2024-12-02 15:48:52 -05:00
Simon Cruanes
8f0dac2dfe
missing file 2024-12-02 15:32:08 -05:00
Simon Cruanes
ce6119d456
and tests 2024-12-02 14:56:45 -05:00
Simon Cruanes
b966a9eccc
feat multipart-form: expose content_disposition 2024-12-02 14:56:35 -05:00