MCPcopy Index your code
hub / github.com/perkeep/perkeep / ServeHTTP

Method ServeHTTP

pkg/blobserver/gethandler/get.go:52–60  ·  view source on GitHub ↗
(rw http.ResponseWriter, req *http.Request)

Source from the content-addressed store, hash-verified

50}
51
52func (h *Handler) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
53 blobRef := blobFromURLPath(req.URL.Path)
54 if !blobRef.Valid() {
55 http.Error(rw, "Malformed GET URL.", http.StatusBadRequest)
56 return
57 }
58
59 ServeBlobRef(rw, req, blobRef, h.Fetcher)
60}
61
62// ServeBlobRef serves a blob.
63func ServeBlobRef(rw http.ResponseWriter, req *http.Request, blobRef blob.Ref, fetcher blob.Fetcher) {

Callers

nothing calls this directly

Calls 4

blobFromURLPathFunction · 0.85
ServeBlobRefFunction · 0.85
ValidMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected