MCPcopy
hub / github.com/danielgtaylor/huma / WriteHeader

Method WriteHeader

adapters/humaecho/humaecho_test.go:33–45  ·  view source on GitHub ↗
(code int)

Source from the content-addressed store, hash-verified

31}
32
33func (m *flushingResponseWriter) WriteHeader(code int) {
34 if m.wroteHeader {
35 return
36 }
37 m.wroteHeader = true
38 // Write current headers to the recorder
39 for k, v := range m.header {
40 m.rec.Header()[k] = v
41 }
42 m.rec.WriteHeader(code)
43 // Create a new header map so subsequent changes are NOT reflected in the recorder
44 m.header = make(http.Header)
45}
46
47func (m *flushingResponseWriter) Write(b []byte) (int, error) {
48 if !m.wroteHeader {

Callers 15

WriteMethod · 0.95
ServeHTTPMethod · 0.45
ServeHTTPMethod · 0.45
BenchmarkRawBunRouterFunction · 0.45
SetStatusMethod · 0.45
SetStatusMethod · 0.45
SetStatusMethod · 0.45
NewFunction · 0.45
SetStatusMethod · 0.45
BenchmarkRawEchoFunction · 0.45
BenchmarkRawEchoFastFunction · 0.45

Calls 1

HeaderMethod · 0.65

Tested by

no test coverage detected