(statusCode int)
| 38 | } |
| 39 | |
| 40 | func (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) |
| 64 | func (w *StreamingResponseWriter) sendChunk(data []byte) { |
no outgoing calls
no test coverage detected