MCPcopy
hub / github.com/tinode/chat / WriteHeader

Method WriteHeader

server/http.go:179–187  ·  view source on GitHub ↗
(status int)

Source from the content-addressed store, hash-verified

177}
178
179func (w *errorResponseWriter) WriteHeader(status int) {
180 if status >= http.StatusBadRequest {
181 // charset=utf-8 is the default. No need to write it explicitly
182 // Must set all the headers before calling super.WriteHeader()
183 w.ResponseWriter.Header().Set("Content-Type", "application/json")
184 }
185 w.status = status
186 w.ResponseWriter.WriteHeader(status)
187}
188
189func (w *errorResponseWriter) Write(p []byte) (n int, err error) {
190 if w.status >= http.StatusBadRequest {

Callers 6

serve404Function · 0.80
serveWebSocketFunction · 0.80
serveLongPollFunction · 0.80
servePprofErrorFunction · 0.80
largeFileServeHTTPFunction · 0.80
largeFileReceiveHTTPFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected