MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / WriteHeader

Method WriteHeader

rest/encoded_response_writer.go:67–76  ·  view source on GitHub ↗

WriteHeader uses underlying http.ResponseWriter WriteHeader method

(status int)

Source from the content-addressed store, hash-verified

65
66// WriteHeader uses underlying http.ResponseWriter WriteHeader method
67func (w *EncodedResponseWriter) WriteHeader(status int) {
68 w.status = status
69 w.sniff(nil) // Must do it now because headers can't be changed after WriteHeader call
70 if w.headerWritten {
71 return
72 }
73 w.ResponseWriter.WriteHeader(status)
74 w.headerWritten = true
75
76}
77
78// WriteHeader uses underlying http.ResponseWriter Write if gzip is disabled, otherwise uses underlying http.ResponseWriter
79func (w *EncodedResponseWriter) Write(b []byte) (int, error) {

Callers 11

writeStatusMethod · 0.45
handleGetAttachmentMethod · 0.45
discoveryHandlerMethod · 0.45
renderJSONFunction · 0.45
authHandlerMethod · 0.45
tokenHandlerMethod · 0.45

Calls 1

sniffMethod · 0.95

Tested by 6

discoveryHandlerMethod · 0.36
renderJSONFunction · 0.36
authHandlerMethod · 0.36
tokenHandlerMethod · 0.36