Commit graph

54 commits

Author SHA1 Message Date
Matt Brubeck
c12b2ab656 Factor out response code 2020-06-28 15:08:31 -07:00
Matt Brubeck
29fddfe41e Minor cleanup 2020-06-20 12:14:07 -07:00
Matt Brubeck
b25da60e10 Make usage output friendlier 2020-06-20 11:16:41 -07:00
Matt Brubeck
9b260dfdd2 Link to pre-compiled binary 2020-06-20 10:53:10 -07:00
Matt Brubeck
a20af4ad12 Version 1.2.1
* Reduce memory usage when serving large files
* Update dependencies
2020-06-20 10:35:05 -07:00
Matt Brubeck
443e83f01b Update dependencies 2020-06-20 10:32:59 -07:00
Matt Brubeck
95f03cf143 Never read whole file into memory 2020-06-20 10:30:43 -07:00
Matt Brubeck
76bbfafee5 Minor cleanup 2020-06-20 10:02:36 -07:00
Matt Brubeck
59c921c5d5 Switch to fork of tree_magic 2020-06-10 08:42:57 -07:00
Matt Brubeck
c4aa71836b Update dependencies 2020-06-08 18:28:48 -07:00
Matt Brubeck
7899d9addb Change file extension from .gemini to .gmi 2020-06-07 08:53:32 -07:00
Matt Brubeck
5314e23415 Update depedencies 2020-05-22 19:13:38 -07:00
Matt Brubeck
2632bf14be Minor cleanup 2020-05-22 19:13:27 -07:00
Matt Brubeck
798506a03c Fix error message when request is too long 2020-05-22 19:08:00 -07:00
Matt Brubeck
7588b23fcb Switch from lazy_static to once_cell 2020-05-22 19:03:41 -07:00
Matt Brubeck
8e13714011 comments 2020-05-22 18:37:55 -07:00
Matt Brubeck
cac7e394be Minor cleanup in parse_request 2020-05-22 15:26:16 -07:00
Matt Brubeck
a049beb66b Improved request parsing.
Only read up to 1024 bytes plus CRLF. This avoids allocations and
copies, and prevents malicious/buggy clients from making us allocate
unbounded amounts of memory.

We also stop if we see a lone LF, rather than timing out until CRLF is
received.
2020-05-22 08:45:58 -07:00
Matt Brubeck
039057b8db Improve request parsing 2020-05-22 08:32:44 -07:00
Matt Brubeck
0d872688f9 Use temporary fork of tree_magic 2020-05-21 17:05:06 -07:00
Matt Brubeck
ce570fc8c4 Auto-detect MIME types 2020-05-21 15:29:04 -07:00
Matt Brubeck
db5665b783 Update dependencies 2020-05-21 10:37:50 -07:00
Matt Brubeck
6f490876cd Check URL schemes 2020-05-21 10:36:49 -07:00
Matt Brubeck
3a41f40775 Redirect on URLs without trailing slash 2020-05-21 10:11:49 -07:00
Matt Brubeck
ca85842369 Fix error response codes 2020-05-21 09:35:43 -07:00
Matt Brubeck
eaebcb2046 Update dependencies 2020-05-20 15:34:07 -07:00
Matt Brubeck
2b26ed9167 README 2020-05-20 14:51:00 -07:00
Matt Brubeck
45d2e8cf80 Use async filesystem I/O 2020-05-20 08:40:49 -07:00
Matt Brubeck
73fa0e0f01 Code cleanup 2020-05-20 08:33:31 -07:00
Matt Brubeck
85ea736eb2 Don't panic on cannot-be-a-base URLs 2020-05-20 08:28:22 -07:00
Matt Brubeck
0872e3d1fe Remove unnecessary path check 2020-05-20 08:24:45 -07:00
Matt Brubeck
b728df0ee8 Code cleanup 2020-05-20 08:18:35 -07:00
Matt Brubeck
db0785c4b9 Use index.gemini instead of dir listings 2020-05-20 08:10:50 -07:00
Matt Brubeck
d6cb2e831b Directory listing 2020-05-19 22:07:31 -07:00
Matt Brubeck
259a190a9c Command-line args 2020-05-19 21:24:27 -07:00
Matt Brubeck
a165e8e142 Make TLS config global 2020-05-19 15:10:55 -07:00
Matt Brubeck
8d09b268f9 More error handling 2020-05-19 14:52:19 -07:00
Matt Brubeck
edec8f08bc Switch to pkcs8 key file 2020-05-17 19:13:18 -07:00
Matt Brubeck
b5ce738240 File serving 2020-05-17 18:17:46 -07:00
Matt Brubeck
7eeba3959e Path validation 2020-05-17 12:25:39 -07:00
Matt Brubeck
0e6163dcd9 Url parsing 2020-05-17 12:14:29 -07:00
Matt Brubeck
e911d7e38d Add test key 2020-05-17 12:12:53 -07:00
Matt Brubeck
ece2f20305 Fix MIME type 2020-05-17 10:43:15 -07:00
Matt Brubeck
9e039177df Code cleanup 2020-05-17 10:41:15 -07:00
Matt Brubeck
bf09e83d53 Minor changes 2020-05-17 10:39:30 -07:00
Matt Brubeck
a0c20258cb Working echo server 2020-05-17 10:19:34 -07:00
Matt Brubeck
bf439b4c52 Trying to fix TLS 2020-05-17 09:58:55 -07:00
Matt Brubeck
9d1e5f1d21 WIP: Basic echo 2020-05-17 09:46:06 -07:00
Matt Brubeck
45faee45a7 Start of handle_connection 2020-05-17 09:40:50 -07:00
Matt Brubeck
dc41732486 panic=abort 2020-05-17 09:05:19 -07:00