MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / WriteHeader

Method WriteHeader

pkg/waveapp/streamingresp.go:40–61  ·  view source on GitHub ↗
(statusCode int)

Source from the content-addressed store, hash-verified

38}
39
40func (w *StreamingResponseWriter) WriteHeader(statusCode int) {
41 if w.headerSent {
42 return
43 }
44
45 w.statusCode = statusCode
46 w.headerSent = true
47
48 headers := make(map[string]string)
49 for key, values := range w.header {
50 if len(values) > 0 {
51 headers[key] = values[0]
52 }
53 }
54
55 w.respChan <- wshrpc.RespOrErrorUnion[wshrpc.VDomUrlRequestResponse]{
56 Response: wshrpc.VDomUrlRequestResponse{
57 StatusCode: w.statusCode,
58 Headers: headers,
59 },
60 }
61}
62
63// sendChunk sends a single chunk of exactly maxChunkSize (or less)
64func (w *StreamingResponseWriter) sendChunk(data []byte) {

Callers 4

VDomUrlRequestCommandMethod · 0.95
WriteMethod · 0.95
CloseMethod · 0.95
ServeFileOptionFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected