darkhttpd/devel
André Kugland defc1e8ce9
Custom headers with the CLI option `--header` (#28)
These changes add a command-line option --header, e.g. --header 'Access-Control-Allow-Origin: *'.

Basic tests are included for this option.

When accepting the argument, a very simple sanitization is made, the string is required to contain ": ", and can’t contain a '\n' character. These checks are far from what is required to truly validate a HTTP header, but will at least detect simple mistakes and forbid the abuse of having arguments that include more than one header, or, worse, that include a body for the response (after "\r\n\r\n").

This should also close the Issue #16 and PR #27, I think, since CORS functionality can be obtained by specifying a custom header.
2022-12-06 21:46:52 +11:00
..
fuzz_testcases Add a harness for fuzzing make_safe_uri() 2015-01-01 18:15:10 +11:00
Makefile Clean up after fuzzers. 2021-02-21 17:10:18 +11:00
bench.c Add benchmark. 2018-12-11 00:42:52 +11:00
checker Catch up to clang changes. 2016-01-14 00:57:42 +11:00
clang-warns clang-warns: use clang in path by default. 2020-07-01 19:41:46 +10:00
cppcheck Indent, add dir, allow inconclusive. 2016-01-11 00:32:15 +11:00
fuzz_llvm.sh Add LLVM fuzzer. 2018-12-09 23:13:17 +11:00
fuzz_llvm_make_safe_uri.c fuzz_llvm_make_safe_uri: get code from darkhttpd.c 2021-03-21 15:13:44 +11:00
fuzz_socket.cc fuzzer: take optional port number from environment variable. 2022-10-02 12:24:17 +11:00
fuzz_socket.sh fuzzer: take optional port number from environment variable. 2022-10-02 12:24:17 +11:00
open_sockets.py open_sockets.py: remove unused import. 2022-11-23 11:18:39 +11:00
run-tests Custom headers with the CLI option `--header` (#28) 2022-12-06 21:46:52 +11:00
test.py Fix crash when a file has a large (year 10,000+) mtime. 2022-10-02 11:50:02 +11:00
test_auth.py test_auth: Add test for wrong auth. 2021-01-17 16:55:09 +11:00
test_custom_headers.py Custom headers with the CLI option `--header` (#28) 2022-12-06 21:46:52 +11:00
test_forward.py More Python 3 updates. 2021-01-17 17:29:23 +11:00
test_forward_all.py More Python 3 updates. 2021-01-17 17:29:23 +11:00
test_forward_https.py Add tests for --forward-https. 2021-08-22 13:18:36 +10:00
test_make_safe_uri.c Improve make_safe_uri coverage. 2021-03-21 15:31:04 +11:00
test_mimemap.py More Python 3 updates. 2021-01-17 17:29:23 +11:00
test_no_listing.py More Python 3 updates. 2021-01-17 17:29:23 +11:00
test_server_id.py Don't include URL or method in default_reply. 2021-02-21 17:09:27 +11:00
test_timeout.py More Python 3 updates. 2021-01-17 17:29:23 +11:00
warns warns: build with -std=c90. 2021-03-21 15:01:17 +11:00