MCPcopy Create free account
hub / github.com/dgrr/http2 / ServeHTTP

Method ServeHTTP

examples/proxy/main.go:264–274  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

262type ReqHandler struct{}
263
264func (rh *ReqHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
265 if r.FormValue("long") == "" {
266 fmt.Fprintf(w, "Hello 21th century!\n")
267 } else {
268 bf := bytes.NewBuffer(nil)
269 for i := 0; i < 1<<24; i++ {
270 io.WriteString(bf, "A")
271 }
272 w.Write(bf.Bytes())
273 }
274}
275
276func startFastBackend() {
277 certData, priv, err := GenerateTestCertificate(*hostArg)

Callers

nothing calls this directly

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected