Commit Graph

43 Commits

Author SHA1 Message Date
f6d3c47816 Export TLS & remove conn in request struct
This makes it possible to fully create another request outside of this module
(which Hnakra will need) and has better parity with net/http.
2023-05-26 00:38:12 -04:00
Adnan Maolood
5141eaafaa Tweak request and response parsing 2021-03-20 12:27:20 -04: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
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
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
de339490f4 Move ResponseWriter Conn and TLS methods to Request 2021-02-24 08:24:49 -05:00
Adnan Maolood
75abb99518 request: Remove TLS and Conn methods 2021-02-23 20:57:53 -05:00
Adnan Maolood
02bbedc330 Update documentation 2021-02-23 18:45:58 -05:00
Adnan Maolood
311233a012 request: Fix documentation for TLS 2021-02-23 17:30:46 -05:00
Adnan Maolood
c688defefd request: Add Conn and TLS methods 2021-02-23 17:29:50 -05:00
Adnan Maolood
15f3e764c5 server: Populate Request.Host field 2021-02-20 18:12:51 -05:00
Adnan Maolood
2308c6407f server: Make Request.RemoteAddr a net.Addr
A concrete type is better.
2021-02-20 16:27:35 -05:00
Adnan Maolood
3f4fd10b6d client: Make Get and Do accept a Context
This removes the need for Request.Context.
2021-02-20 15:34:21 -05:00
Adnan Maolood
a7f958b20d server: Make Request.RemoteAddr a string 2021-02-20 13:31:55 -05:00
Adnan Maolood
0ab236c736 client: Allow Request.Host to omit a port 2021-02-20 13:30:55 -05:00
Adnan Maolood
229ebb4106 request.Write: Accept an io.Writer 2021-02-18 21:58:37 -05:00
Adnan Maolood
6928a1efef request.Write: return error from Flush 2021-02-18 21:54:38 -05:00
Adnan Maolood
779be8b95b request: Allow User in URLs 2021-02-16 00:55:56 -05:00
Adnan Maolood
19678ef934 Remove NewRequestFromURL method
Use a Request struct literal instead.
2021-02-15 17:23:56 -05:00
Adnan Maolood
96a84ddd38 request: Don't read more than 1026 bytes 2021-02-15 00:16:21 -05:00
Adnan Maolood
92e7a309c6 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
Adnan Maolood
46e10da3a8 Make Request.Host optional 2021-02-14 19:02:34 -05:00
Adnan Maolood
6f7c183662 server: Don't populate Request.Certificate field
Handlers should instead use the certificate provided in Request.TLS.
2021-02-14 17:34:57 -05:00
Adnan Maolood
7c703e95de Update documentation 2021-02-14 15:50:41 -05:00
Adnan Maolood
29f2b3738d Make TLS field nil for unencrypted connections 2021-02-08 12:32:49 -05:00
Adnan Maolood
5e977250ec Update comments 2021-01-10 01:07:38 -05:00
Adnan Maolood
04bd0f4520 Update Request documentation 2020-12-18 01:43:18 -05:00
Adnan Maolood
d34d5df89e Add ReadRequest and ReadResponse functions 2020-12-18 01:42:05 -05:00
Adnan Maolood
decd72cc23 Expose Request.Write and Response.Read functions 2020-12-18 01:14:06 -05:00
Adnan Maolood
176b260468 Allow Request.Context to be nil 2020-12-17 17:16:55 -05:00
Adnan Maolood
16739d20d0 Fix escaping of queries 2020-11-27 22:27:52 -05:00
Adnan Maolood
82688746dd Add context to requests 2020-11-26 00:42:25 -05:00
Adnan Maolood
cec1f118fb Remove some unnecessary errors 2020-11-04 23:46:05 -05:00
Adnan Maolood
b6475aa7d9 server: Populate (*Request).Certificate field 2020-11-01 16:25:59 -05:00
Adnan Maolood
b84811668c Reject schemes other than gemini:// in NewRequest 2020-10-27 21:18:05 -04:00
Adnan Maolood
239ec885f7 Add (*Client).Get function 2020-10-27 19:22:34 -04:00
Adnan Maolood
8ab4064841 Add NewRequestFromURL function 2020-10-27 13:27:52 -04:00
Adnan Maolood
f0345f3495 Rename repository to go-gemini 2020-10-24 15:15:32 -04:00
Adnan Maolood
9506f69f1a Refactor 2020-10-21 17:07:28 -04:00