MCPcopy Index your code
hub / github.com/tailscale/tailscale / WriteHeader

Method WriteHeader

tsweb/tsweb.go:694–703  ·  view source on GitHub ↗

WriteHeader implements [http.ResponseWriter].

(statusCode int)

Source from the content-addressed store, hash-verified

692
693// WriteHeader implements [http.ResponseWriter].
694func (lg *loggingResponseWriter) WriteHeader(statusCode int) {
695 if lg.code != 0 {
696 lg.logf("[unexpected] HTTP handler set statusCode twice (%d and %d)", lg.code, statusCode)
697 return
698 }
699 if lg.ctx.Err() == nil {
700 lg.code = statusCode
701 }
702 lg.ResponseWriter.WriteHeader(statusCode)
703}
704
705// Write implements [http.ResponseWriter].
706func (lg *loggingResponseWriter) Write(bs []byte) (int, error) {

Callers 15

TestListenServiceFunction · 0.45
ServeHTTPMethod · 0.45
TestStdHandlerFunction · 0.45
TestStdHandler_CanceledFunction · 0.45
handleErrorMethod · 0.45
WriteHTTPErrorFunction · 0.45
handlerFunction · 0.45
RunHandlerMethod · 0.45
RunAllHandlerMethod · 0.45
ServeHTTPMethod · 0.45

Calls 2

logfMethod · 0.45
ErrMethod · 0.45

Tested by 15

TestListenServiceFunction · 0.36
TestStdHandlerFunction · 0.36
TestStdHandler_CanceledFunction · 0.36
ServeHTTPMethod · 0.36
DoNoiseRequestMethod · 0.36
TestMultipleRecordersFunction · 0.36
mkWorldFunction · 0.36
TestRoundTripFunction · 0.36