Adnan Maolood
c85759d777
fs: Improve redirect behavior
2021-04-21 12:41:56 -04:00
Adnan Maolood
507773618b
fs: Refactor
2021-04-21 12:18:52 -04:00
Adnan Maolood
3bc243dd66
fs: Remove ServeContent function
2021-04-21 11:41:40 -04:00
Adnan Maolood
de93d44786
LoggingMiddleware: Prevent writing empty meta
2021-04-21 11:38:34 -04:00
Adnan Maolood
eb32c32063
fs: Fix panic on indexing URL of zero length
2021-04-21 11:36:43 -04:00
Adnan Maolood
e5cf345273
Update README.md
2021-03-24 13:30:46 -04:00
Adnan Maolood
c68ce57488
mux: Add copyright notice
2021-03-24 13:09:53 -04:00
Adnan Maolood
2b161650fe
Split LICENSE into two files
2021-03-24 13:08:32 -04:00
Adnan Maolood
dbbef1fb6d
Revert "Require Go 1.16"
...
This reverts commit 0e87d64ffc .
2021-03-23 22:05:12 -04:00
Adnan Maolood
90518a01a8
Revert "Replace uses of ioutil with io"
...
This reverts commit 19f1d6693e .
2021-03-23 22:02:32 -04:00
Adnan Maolood
056e55abbb
response: Remove unnecessary length check
2021-03-20 18:29:40 -04:00
Adnan Maolood
72d437c82e
response: Limit response header size
2021-03-20 14:01:45 -04:00
Adnan Maolood
3dca29eb41
response: Don't use bufReadCloser
2021-03-20 13:41:53 -04:00
Adnan Maolood
a40b5dcd0b
fs: Fix empty media type for directory index pages
2021-03-20 13:33:15 -04:00
Adnan Maolood
fffe86680e
client: Only get cert if TrustCertificate is set
2021-03-20 12:54:41 -04:00
Adnan Maolood
d5af32e121
client: Close connection on error
2021-03-20 12:49:27 -04:00
Adnan Maolood
5141eaafaa
Tweak request and response parsing
2021-03-20 12:27:20 -04:00
Adnan Maolood
e5c0afa013
response: Treat empty meta as invalid
2021-03-20 12:07:24 -04:00
Adnan Maolood
4c7c200f92
Remove unused field
2021-03-20 12:05:21 -04:00
Adnan Maolood
0a709da439
Remove charset=utf-8 from default media type
2021-03-20 12:04:42 -04:00
Adnan Maolood
1fdef9b608
Rename ServeMux to Mux
2021-03-15 15:44:35 -04:00
Adnan Maolood
2144e2c2f2
status: Reintroduce StatusSensitiveInput
2021-03-15 15:19:43 -04:00
Adnan Maolood
93a606b591
certificate.Store: Call os.MkdirAll on Load
2021-03-09 08:59:28 -05:00
Adnan Maolood
b00794f236
tofu: Use stricter file permissions
2021-03-09 08:58:36 -05:00
Adnan Maolood
dea7600f29
Remove StatusSensitiveInput
2021-03-08 14:08:45 -05:00
Adnan Maolood
7d958a4798
examples/client: Fix certificate trust check
2021-03-08 14:07:18 -05:00
Adnan Maolood
a5493b708a
tofu: Fix known host unmarshaling
2021-03-06 15:49:11 -05:00
Adnan Maolood
6e5c2473e7
tofu: Use base64-encoded sha256 fingerprints
2021-03-06 15:24:15 -05:00
Adnan Maolood
c639233ea1
tofu: Fix format in error message
2021-03-06 15:13:06 -05:00
Adnan Maolood
5677440876
tofu: Automatically create file in KnownHosts.Load
2021-03-06 15:11:30 -05:00
Adnan Maolood
be3d09d7f4
certificate.Store: Don't call os.MkdirAll
2021-03-06 13:11:11 -05:00
Adnan Maolood
504da9afd8
certificate.Store: Don't check parent scopes in Lookup
...
Limit the scopes of client certificates to hostnames only instead of
hostnames and paths.
2021-03-06 12:59:33 -05:00
Adnan Maolood
d1cb8967b6
certificate.Store: Make 100 years the default duration
2021-03-05 23:29:56 -05:00
Adnan Maolood
107b3a1785
Move LoggingMiddleware out of examples/server.go
2021-03-05 11:35:01 -05:00
Adnan Maolood
e7a06a12bf
certificate.Store: Clean scope path in Load
...
Clean the scope path so that trimming the path from the scope works for
relative paths.
2021-03-05 10:51:55 -05:00
Adnan Maolood
649b20659b
Revert "certificate: Remove Subject from CreateOptions"
...
This reverts commit ce649ecc66 .
2021-03-04 20:04:46 -05:00
Adnan Maolood
c9e2af98f3
Revert "certificate.Store: Allow using '*' in DNSNames"
...
This reverts commit de0b93a4f6 .
2021-03-04 19:26:13 -05:00
Adnan Maolood
d6d02e398e
certificate.Store: Bump default duration to 250 years
2021-03-04 16:55:09 -05:00
Adnan Maolood
de0b93a4f6
certificate.Store: Allow using '*' in DNSNames
...
This isn't exactly a valid DNSName, but it reduces the number of
certificates that need to be created. Clients should either accept it or
skip checking DNSNames.
2021-03-04 16:40:25 -05:00
Adnan Maolood
ce649ecc66
certificate: Remove Subject from CreateOptions
2021-03-04 16:27:16 -05:00
Adnan Maolood
688e7e2823
certificate: Fix deadlock in Store.Get
2021-03-04 16:20:57 -05:00
Adnan Maolood
b38311da00
certificate.Store: Fix hostname registration check
2021-03-04 16:12:36 -05:00
Adnan Maolood
8e2ac24830
tofu: Remove expiration timestamp from known hosts
2021-03-04 15:37:02 -05:00
Adnan Maolood
bfa3356d3a
client: Remove hostname verification check
2021-03-04 14:36:31 -05:00
Adnan Maolood
9f3564936e
client: Ignore certificate expiration time
2021-03-04 14:35:51 -05:00
Adnan Maolood
d8fb072826
Rename vendor.go to verify_hostname.go
2021-02-28 23:21:10 -05:00
Adnan Maolood
69f0913b3d
Make Response implement io.WriterTo
2021-02-28 22:21:54 -05:00
Adnan Maolood
f7012b38da
Request.WriteTo: return int64
2021-02-28 22:20:59 -05:00
Adnan Maolood
768ec6c17b
Make Request implement io.WriterTo
2021-02-28 22:16:38 -05:00
Adnan Maolood
ae7d58549d
Add message argument to TimeoutHandler
2021-02-28 22:07:24 -05:00
Adnan Maolood
ad5d78f08f
Mention that Request methods don't work for clients
2021-02-28 21:59:19 -05:00
Adnan Maolood
4b92c71839
Remove Request.RemoteAddr helper method
2021-02-28 21:52:41 -05:00
Adnan Maolood
19f1d6693e
Replace uses of ioutil with io
2021-02-28 21:38:36 -05:00
Adnan Maolood
0e87d64ffc
Require Go 1.16
2021-02-28 21:38:17 -05:00
Adnan Maolood
845f8e9bd1
Reintroduce Response.Write method
2021-02-28 20:50:18 -05:00
Adnan Maolood
cf9ab18c1f
certificate.Store: Check parent scopes in Lookup
2021-02-28 20:23:32 -05:00
Adnan Maolood
ada42ff427
certificate.Store: Support client certificates
2021-02-28 19:29:25 -05:00
Adnan Maolood
fcc71b76d9
examples/server: Clean up LoggingMiddleware
2021-02-27 14:53:37 -05:00
Adnan Maolood
6a1ccdc644
response: Add tests for maximum-length META
2021-02-27 14:08:31 -05:00
Adnan Maolood
f156be19b4
request: Add RemoteAddr helper function
2021-02-27 14:03:33 -05:00
Adnan Maolood
82bdffc1eb
request: Add ServerName helper method
2021-02-27 14:02:30 -05:00
Adnan Maolood
a396ec77e4
request: Cache calls to TLS
2021-02-27 13:59:45 -05:00
Adnan Maolood
21ad3a2ded
server: Disallow ServeConn usage after Shutdown
2021-02-24 19:25:52 -05:00
Adnan Maolood
2d7f28e152
Update examples/client.go
2021-02-24 19:21:31 -05:00
Adnan Maolood
1764e02d1e
Remove ResponseWriter.Close method
2021-02-24 19:00:09 -05:00
Adnan Maolood
1bc5c68c3f
response: Revert to using fields instead of methods
2021-02-24 18:50:40 -05:00
Adnan Maolood
867074d81b
examples/client: Fix display of response status
2021-02-24 16:16:42 -05:00
Adnan Maolood
1da23ba07b
Revert "Replace uses of ioutil with io"
...
This reverts commit 48c67bcead .
2021-02-24 14:45:57 -05:00
Adnan Maolood
cbfbeb6c22
Don't require Go 1.16
2021-02-24 14:29:29 -05:00
Adnan Maolood
c3418fdfed
Add missing import
2021-02-24 14:28:47 -05:00
Adnan Maolood
6181751e8d
Move mimetype registration to gemini.go
2021-02-24 14:27:49 -05:00
Adnan Maolood
48c67bcead
Replace uses of ioutil with io
2021-02-24 11:11:10 -05:00
Adnan Maolood
25f441f573
fs: Remove build constraint
2021-02-24 11:01:02 -05:00
Adnan Maolood
cb7879c966
Add NewResponse function
2021-02-24 10:48:17 -05:00
Adnan Maolood
19bfca1cc3
examples/server: Cancel context
2021-02-24 10:27:28 -05:00
Adnan Maolood
991b18d526
examples/server: Add logging middleware
2021-02-24 10:25:08 -05:00
Adnan Maolood
b66b287f94
ResponseWriter: Remove unexported method
2021-02-24 10:01:46 -05:00
Adnan Maolood
bd29d76f66
client: Fix copying of request
2021-02-24 09:48:23 -05:00
Adnan Maolood
1d20a6c3c8
examples/client: Use Response methods
2021-02-24 09:22:25 -05:00
Adnan Maolood
6f46b2fa47
examples/auth: Use Request.TLS method
2021-02-24 09:22:01 -05:00
Adnan Maolood
15385e3095
fs: Fix Go build constraint comment
2021-02-24 09:00:28 -05:00
Adnan Maolood
3101856afa
response: Move to methods
2021-02-24 08:43:57 -05:00
Adnan Maolood
094c16297b
server: Fix comment
2021-02-24 08:38:08 -05:00
Adnan Maolood
08f5ddd41a
TimeoutHandler: Mention returned error
2021-02-24 08:37:52 -05:00
Adnan Maolood
41c95add81
Add unexported method to timeout writer
2021-02-24 08:34:26 -05:00
Adnan Maolood
de339490f4
Move ResponseWriter Conn and TLS methods to Request
2021-02-24 08:24:49 -05:00
Adnan Maolood
b488146cc6
Remove ResponseWriter.Hijack method
2021-02-24 08:22:12 -05:00
Adnan Maolood
069b473c28
Implement TimeoutHandler by wrapping ResponseWriter
2021-02-24 08:18:23 -05:00
Adnan Maolood
3660698a4b
Make ResponseWriter an interface
...
Make ResponseWriter an interface with an unexported method. Implementors
must embed a ResponseWriter from elsewhere. This gives us the
flexibility of an interface while allowing us to add new methods in the
future.
2021-02-24 00:13:46 -05:00
Adnan Maolood
526d232ab0
Remove ErrHandlerTimeout
2021-02-23 22:15:19 -05:00
Adnan Maolood
f08efa330f
Move TimeoutHandler to handler.go
2021-02-23 22:12:04 -05:00
Adnan Maolood
310bd16344
Unexport NewResponseWriter
2021-02-23 22:02:47 -05:00
Adnan Maolood
9eae88f00c
Reimplement TimeoutHandler
2021-02-23 21:59:16 -05:00
Adnan Maolood
b386a9ba41
response: Change field names
2021-02-23 21:51:42 -05:00
Adnan Maolood
f28a63ff0c
Add ResponseWriter.Hijack method
2021-02-23 21:36:29 -05:00
Adnan Maolood
d35dd3d867
ResponseWriter: Add TLS and Conn methods
2021-02-23 20:59:04 -05:00
Adnan Maolood
75abb99518
request: Remove TLS and Conn methods
2021-02-23 20:57:53 -05:00
Adnan Maolood
e8d98ef4ec
Move I/O utilities to io.go
2021-02-23 20:49:55 -05:00
Adnan Maolood
a65c3c3d4f
Make ResponseWriter a struct
...
Make ResponseWriter a struct again so that it can be extended in a
backwards-compatible way.
2021-02-23 20:41:16 -05:00
Adnan Maolood
64f9381bbc
handler: Mention when the context is canceled
2021-02-23 19:01:12 -05:00