diff options
| author | Shulhan <ms@kilabit.info> | 2019-10-17 15:08:03 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2019-10-17 15:08:03 +0700 |
| commit | 21edfbc8ee4c41bf157f89b42bc5e7c5abb0cb16 (patch) | |
| tree | 77bc5477a1f13ad3570a67f3b0d23242d53fd892 /lib/http | |
| parent | c698f9750a2a30e56a1581aab7fa56b13d32007e (diff) | |
| download | pakakeh.go-21edfbc8ee4c41bf157f89b42bc5e7c5abb0cb16.tar.xz | |
http: remove unneccesary call to WriteHeader with StatusOK
Per documentation,
If WriteHeader is not called explicitly, the first call to Write
will trigger an implicit WriteHeader(http.StatusOK).
Thus explicit calls to WriteHeader are mainly used to
send error codes.
Diffstat (limited to 'lib/http')
| -rw-r--r-- | lib/http/endpoint.go | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/lib/http/endpoint.go b/lib/http/endpoint.go index c56f5e76..49fc0c28 100644 --- a/lib/http/endpoint.go +++ b/lib/http/endpoint.go @@ -119,8 +119,6 @@ func (ep *Endpoint) call( res.Header().Set(ContentType, ContentTypePlain) } - res.WriteHeader(http.StatusOK) - _, e = res.Write(rspb) if e != nil { log.Printf("endpoint.call: %s %s %s\n", req.Method, req.URL.Path, e) |
