MCPcopy Create free account
hub / github.com/cloudfoundry/garden / ServeHTTP

Method ServeHTTP

server/streamer/http_handling.go:10–22  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

8type HandlerFunc func(StreamID, io.Writer)
9
10func (h HandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request) {
11 id := StreamID(r.FormValue(":streamid"))
12 w.WriteHeader(http.StatusOK)
13
14 conn, _, err := w.(http.Hijacker).Hijack()
15 if err != nil {
16 w.WriteHeader(http.StatusInternalServerError)
17 return
18 }
19
20 defer conn.Close()
21 h(id, conn)
22}

Callers 1

NewFunction · 0.80

Calls 3

StreamIDTypeAlias · 0.85
HijackMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected