MCPcopy Create free account
hub / github.com/bepass-org/proxy / WriteHeader

Method WriteHeader

pkg/http/common.go:36–50  ·  view source on GitHub ↗
(statusCode int)

Source from the content-addressed store, hash-verified

34}
35
36func (rw *responseWriter) WriteHeader(statusCode int) {
37 if rw.written {
38 return
39 }
40 rw.status = statusCode
41 rw.written = true
42
43 statusText := http.StatusText(statusCode)
44 if statusText == "" {
45 statusText = fmt.Sprintf("status code %d", statusCode)
46 }
47 _, _ = fmt.Fprintf(rw.conn, "HTTP/1.1 %d %s\r\n", statusCode, statusText)
48 _ = rw.headers.Write(rw.conn)
49 _, _ = rw.conn.Write([]byte("\r\n"))
50}
51
52func (rw *responseWriter) Write(data []byte) (int, error) {
53 if !rw.written {

Callers 1

WriteMethod · 0.95

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected