Commit Graph

410 Commits

Author SHA1 Message Date
Alexey 9205377852 I added utf-8 in your code: "Content-Type: text/html; charset=utf-8\r\n"
(in few places)
2016-01-13 19:59:40 +11:00
Stephen Zhang 26785ceafe Add '<meta charset="utf-8"/>' to the html header
I think most non-English user would need it to fix error encoding in displaying
file name in the web page.
2016-01-13 19:56:23 +11:00
Hugh Wang 4edc50c42f Use UTF-8 as the encoding for directory listing. 2016-01-13 19:53:14 +11:00
Emil Mikulic 853a6af62d Indent, add dir, allow inconclusive. 2016-01-11 00:32:15 +11:00
Hugh Wang 72159c5010 Add support for IPv6. 2015-12-20 21:59:20 +08:00
Emil Mikulic 02b02a7615 Check the bound first.
Found with cppcheck.
2015-05-20 00:06:59 +10:00
Emil Mikulic 1c5fdb5607 Escape URLs according to RFC3986.
Previously, we weren't escaping parentheses when generating directory listings.

Pointed out by: Wijatmoko U. Prayitno
2015-05-19 22:04:39 +10:00
Emil Mikulic c4c0034242 Add --default-mimetype flag. 2015-05-19 21:40:26 +10:00
Emil Mikulic e9aeaba7fe Add test for --no-listing. 2015-05-19 21:30:59 +10:00
Emil Mikulic fc8e127bb7 Fix memory leak. 2015-05-19 21:17:42 +10:00
Christian Hesse 6564a65dfa mention --forward-all in help output
Signed-off-by: Christian Hesse <mail@eworm.de>
2015-05-19 21:04:02 +10:00
Christian Hesse 03f4c1f390 add option to deny directory listing
Signed-off-by: Christian Hesse <mail@eworm.de>
2015-05-19 21:02:58 +10:00
Emil Mikulic 4e726692f4 [ darkhttpd 1.11 release ] 2015-01-01 22:42:44 +11:00
Emil Mikulic aa8046a5a1 Remove unused var, add casts to str_to_num() calls. 2015-01-01 22:41:35 +11:00
Emil Mikulic 49ad7a0421 Call setgroups() before setgid() to drop supplementary groups.
See also: https://www.securecoding.cert.org/confluence/display/seccode/POS36-C.+Observe+correct+revocation+order+while+relinquishing+privileges
2015-01-01 22:22:41 +11:00
Emil Mikulic 03a22661a0 Test keepalive. 2015-01-01 22:18:10 +11:00
Emil Mikulic de92584da1 Add TestHelper.get() 2015-01-01 21:47:59 +11:00
Emil Mikulic 81b1bcbd74 Test for unreadable directory (can't generate listing). 2015-01-01 21:20:08 +11:00
Emil Mikulic d5bd7558f4 Make str_to_num() check for ERANGE, use it instead of atoi(). 2015-01-01 21:00:57 +11:00
Emil Mikulic 4c8b1e22f3 chomp() isn't needed because read_line() strips [cr]lf. 2015-01-01 20:38:38 +11:00
Emil Mikulic 6e1f045393 Test resize in appendl(). 2015-01-01 20:35:37 +11:00
Emil Mikulic 946a910935 Test 404 and 403. 2015-01-01 20:32:52 +11:00
Emil Mikulic 456bbfcde6 Test CRLF handling in read_line(). 2015-01-01 20:17:03 +11:00
Emil Mikulic 72c5539412 When testing, build with -DDEBUG. 2015-01-01 18:32:01 +11:00
Emil Mikulic 4bf0ef5896 Zero slashes should be impossible here. 2015-01-01 18:26:35 +11:00
Emil Mikulic f24c9d0d59 Add a harness for fuzzing make_safe_uri() 2015-01-01 18:15:10 +11:00
Emil Mikulic e50accedb8 cp test_make_safe_uri.c fuzz_make_safe_uri.c 2015-01-01 17:10:47 +11:00
Emil Mikulic 32158f92b4 [ darkhttpd 1.10 release ] 2014-05-26 22:07:59 +10:00
Emil Mikulic 5058dfeb03 Add test for urldecode() 2014-05-26 22:01:22 +10:00
Emil Mikulic 11f953e783 printf [s]size_t as %z[du]. 2014-05-26 21:56:45 +10:00
Emil Mikulic 0001301dae cppcheck: use --force to check all #ifdef configurations. 2014-05-26 21:56:29 +10:00
Emil Mikulic e8a38f9c6a Remove query params.
Reported by: James Antill
https://bugzilla.redhat.com/show_bug.cgi?id=1099199
2014-05-26 21:36:29 +10:00
Emil Mikulic 5854227fc7 Mark cppcheck executable. 2014-03-14 22:51:43 +11:00
Emil Mikulic 9fe3ed4fc1 Run test_make_safe_uri. Retire broken run-tests.sh 2014-03-14 22:50:44 +11:00
Emil Mikulic a8bc378777 Silence warning about unused arg. 2014-03-14 22:45:39 +11:00
Emil Mikulic 583ff7ce10 Retab README. No content changes. 2014-03-14 22:43:46 +11:00
Christian Hesse 01ec165a51 Add .gitignore.
Stop git complaining about untracked file darkhttpd.
2014-03-14 22:42:05 +11:00
Emil Mikulic f73bf69a1e Implement --forward-all to forward all requests to a given url.
Suggested and initially implemented by: Christian Hesse <mail@eworm.de>
2014-03-14 22:40:55 +11:00
Emil Mikulic d28bb0c9f7 ntohs() when reporting the port number.
Re-use addrin when fetching the port number.
2014-03-14 22:18:51 +11:00
Lukas Stabe 28c382d454 exit cleanly for `--help` 2014-03-14 22:07:37 +11:00
Lukas Stabe aa9859413e document port 0 == random available 2014-03-14 22:07:37 +11:00
Lukas Stabe bcadc424a4 display actual port and address 2014-03-14 22:07:37 +11:00
Emil Mikulic b43fee3c83 Don't fprintf() inside signal handler, mark running as volatile. 2014-03-14 21:52:59 +11:00
Emil Mikulic c97d2c4042 Add script to run cppcheck. 2014-03-14 21:52:59 +11:00
Emil Mikulic c44730e177 More cppcheck nits. 2014-03-14 21:52:59 +11:00
Emil Mikulic ad1f132cf2 Reduce variable scope to make cppcheck happy. 2014-03-14 21:52:59 +11:00
Emil Mikulic 7dc06f3096 Add test for --mimetypes 2013-06-10 20:44:20 +10:00
Emil Mikulic e6680c4f2f Add test to exercise memove() in make_safe_url() 2013-06-10 19:26:25 +10:00
Emil Mikulic ecfac80174 README: update default port. 2013-06-10 18:59:55 +10:00
Emil Mikulic 1f3f104166 Fix file_exists() comparison.
Found with: git://repo.or.cz/smatch.git
2013-06-10 18:56:14 +10:00