1
0
mirror of https://git.sr.ht/~adnano/go-gemini synced 2024-09-18 13:31:36 +02:00
Commit Graph

586 Commits

Author SHA1 Message Date
adnano
8060304af2 certificate: Implement GetCertificate callback 2021-02-19 18:42:53 -05:00
adnano
0b364cb2dd mux: Reject empty patterns 2021-02-19 18:06:54 -05:00
adnano
7c7ebd375f server: Remove Certificates field
Use GetCertificate to retrieve certificates without consulting
Certificates.
2021-02-18 22:22:20 -05:00
adnano
e38ab376f7 request.Write: Accept an io.Writer 2021-02-18 21:58:37 -05:00
adnano
fd3babb40f client: Remove superfluous call to Flush 2021-02-18 21:55:17 -05:00
adnano
48e5ca5701 request.Write: return error from Flush 2021-02-18 21:54:38 -05:00
adnano
207128f79c doc: Update package documentation 2021-02-18 00:38:03 -05:00
adnano
38e0b9b412 response: Implement Write method 2021-02-18 00:07:43 -05:00
adnano
de1e9f071a response: Rename statusCode to status 2021-02-18 00:06:34 -05:00
adnano
98d74f0b34 response: Ensure that only one header is written 2021-02-17 23:05:24 -05:00
adnano
c38d0f7c16 Remove .gitignore 2021-02-17 20:40:53 -05:00
adnano
a6c922e1b2 examples: Use Server.Handler 2021-02-17 20:35:27 -05:00
adnano
6b39542d56 server: Add Handler field and remove Handle methods 2021-02-17 20:31:03 -05:00
adnano
b94ed31784 mux: Implement matching of schemes and hostnames 2021-02-17 20:09:42 -05:00
adnano
413ecf9913 Reverse order of RedirectHandler arguments 2021-02-17 19:53:00 -05:00
adnano
ae803cc7ec Add utility Handler functions 2021-02-17 19:27:25 -05:00
adnano
3ae7a859c4 examples: Use new ResponseWriter interface 2021-02-17 13:39:23 -05:00
adnano
b704a470a7 Redesign ResponseWriter interface 2021-02-17 13:36:16 -05:00
adnano
33953f28e1 status: Fix typo 2021-02-17 12:23:03 -05:00
adnano
e4c50cf9ff Rename Meta to StatusText
Rename Meta to StatusText and support all status codes.
2021-02-17 12:06:43 -05:00
adnano
e23fd5217e Move ResponseWriter.Flush to Flusher interface 2021-02-17 11:44:13 -05:00
adnano
ce0d637e4d fs: Reject potentially unsafe requests in ServeFile
Reject requests where r.URL.Path contains a ".." path element to protect
against callers who might unsafely use filepath.Join on r.URL.Path
without sanitizing it.
2021-02-17 11:17:13 -05:00
adnano
acb0f0012e fs: Add ServeContent function 2021-02-17 11:15:30 -05:00
adnano
0d1cec7086 examples/server: Use os.DirFS 2021-02-17 09:25:44 -05:00
adnano
a283a156eb fs: Fix redirect to canonical file path 2021-02-17 09:24:09 -05:00
adnano
cdd0a37908 fs: Add redirects 2021-02-17 01:38:18 -05:00
adnano
a14c0c1825 fs: Trim trailing slash from name in ServeFile 2021-02-17 01:36:53 -05:00
adnano
bf95ca8ed8 fs: Clean paths before handling with FileServer 2021-02-17 00:59:15 -05:00
adnano
6423382749 fs: Show listing for directories without index files 2021-02-17 00:08:14 -05:00
adnano
5b8b7b436e fs: Remove leading slash before opening files 2021-02-16 23:18:37 -05:00
adnano
1d4f1baac4 Replace uses of ioutil with io 2021-02-16 18:57:24 -05:00
adnano
55aa05307f fs: Replace FileSystem with io/fs.FS 2021-02-16 18:53:56 -05:00
adnano
b8a282be04 Require Go 1.16 2021-02-16 18:50:42 -05:00
adnano
9c13a3ba79 client: Don't try to verify unicode hostname 2021-02-16 11:27:53 -05:00
adnano
c9e139c90d Update examples/auth.go 2021-02-16 11:26:09 -05:00
adnano
087c8a62e7 request: Allow User in URLs 2021-02-16 00:55:56 -05:00
adnano
1c32f4d5aa Add build status badge to README.md 2021-02-16 00:07:01 -05:00
adnano
0282c1971c Add build manifest 2021-02-16 00:05:10 -05:00
adnano
c61ce13edb server: Prevent adding Listeners after Close
Check done after calling trackListener to prevent the listener from
being registered after the server is closed.
2021-02-15 20:19:44 -05:00
adnano
352b95587f server: Avoid creating a new Listener after Close 2021-02-15 20:16:32 -05:00
adnano
a90a6240e7 server: Use separate mutex for handlers 2021-02-15 20:05:47 -05:00
adnano
7d03e3c9f4 Add some tests 2021-02-15 19:20:37 -05:00
adnano
a852aa8ac8 Return ErrInvalidResponse on error reading status
Return ErrInvalidResponse when unable to read the response status code
instead of returning the error from strconv.
2021-02-15 19:18:23 -05:00
adnano
317faffdeb Remove NewRequestFromURL method
Use a Request struct literal instead.
2021-02-15 17:23:56 -05:00
adnano
cbb2ef363a server: Rename responder to handler 2021-02-15 01:15:23 -05:00
adnano
b3fc301c13 server: Recover from ServeGemini panics 2021-02-15 00:36:33 -05:00
adnano
924bb31496 request: Don't read more than 1026 bytes 2021-02-15 00:16:21 -05:00
adnano
f8fcb11613 server: Implement Close and Shutdown methods 2021-02-14 23:58:33 -05:00
adnano
b8a6078815 Tweak returned error for requests that are too long
Return ErrInvalidRequest instead of ErrInvalidURL in Request.Write.
2021-02-14 23:33:18 -05:00
adnano
99cac894e9 fs: Refactor 2021-02-14 19:50:38 -05:00