Write writes the data to the connection as part of an HTTP reply. If WriteHeader has not yet been called, Write calls WriteHeader(http.StatusOK) before writing the data. If the Header does not contain a Content-Type line, Write adds a Content-Type set to the result of passing the initial 512 bytes
(data []byte)
| 60 | // Content-Type line, Write adds a Content-Type set to the result of passing |
| 61 | // the initial 512 bytes of written data to DetectContentType. |
| 62 | func (rl *ResponseLogWriter) Write(data []byte) (int, error) { |
| 63 | if !rl.wroteHeader { |
| 64 | rl.WriteHeader(http.StatusOK) |
| 65 | } |
| 66 | ret, err := rl.Resp.Write(data) |
| 67 | rl.Timer.ResponseDone() |
| 68 | return ret, err |
| 69 | } |
| 70 | |
| 71 | // WriteHeader sends an HTTP response header with status code. |
| 72 | // If WriteHeader is not called explicitly, the first call to Write |
nothing calls this directly
no test coverage detected