From 9b700f798494670cd15e7cb863aa98e22fe37108 Mon Sep 17 00:00:00 2001 From: Jonathan Giannuzzi Date: Mon, 30 Jul 2018 17:00:33 +0200 Subject: [PATCH] Add status text based on status code on new HTTP responses --- responses.go | 1 + 1 file changed, 1 insertion(+) diff --git a/responses.go b/responses.go index b304b882..e1bf28fc 100644 --- a/responses.go +++ b/responses.go @@ -21,6 +21,7 @@ func NewResponse(r *http.Request, contentType string, status int, body string) * resp.Header = make(http.Header) resp.Header.Add("Content-Type", contentType) resp.StatusCode = status + resp.Status = http.StatusText(status) buf := bytes.NewBufferString(body) resp.ContentLength = int64(buf.Len()) resp.Body = ioutil.NopCloser(buf)