diff options
| author | Adnan Maolood <[email protected]> | 2021-02-23 21:59:16 -0500 |
|---|---|---|
| committer | Adnan Maolood <[email protected]> | 2021-02-23 21:59:16 -0500 |
| commit | 9eae88f00c317bb1c221da8309e84c932ab4d7fa (patch) | |
| tree | 71a1d40f1ccb0c84ae904dba2552414230b5f7c5 /response.go | |
| parent | response: Change field names (diff) | |
| download | go-gemini-9eae88f00c317bb1c221da8309e84c932ab4d7fa.tar.xz go-gemini-9eae88f00c317bb1c221da8309e84c932ab4d7fa.zip | |
Reimplement TimeoutHandler
Diffstat (limited to 'response.go')
| -rw-r--r-- | response.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/response.go b/response.go index 1d7a870..b939e5b 100644 --- a/response.go +++ b/response.go @@ -138,6 +138,14 @@ func NewResponseWriter(w io.WriteCloser) *ResponseWriter { } } +func (w *ResponseWriter) reset(wc io.WriteCloser) { + w.bw.Reset(wc) + *w = ResponseWriter{ + bw: w.bw, + cl: wc, + } +} + // SetMediaType sets the media type that will be sent by Write for a // successful response. If no media type is set, a default of // "text/gemini; charset=utf-8" will be used. |