MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / ServeHTTP

Method ServeHTTP

internal/cli/capabilities_probe_test.go:19–29  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

17}
18
19func (h *capsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
20 if r.URL.Path != "/api/v1/server/capabilities" {
21 w.WriteHeader(http.StatusNotFound)
22 return
23 }
24 h.hits.Add(1)
25 w.WriteHeader(int(h.status.Load()))
26 if b, _ := h.body.Load().(string); b != "" {
27 _, _ = w.Write([]byte(b))
28 }
29}
30
31func TestCollectionNotFoundIsAuthoritative_Definitive_CachesVerdict(t *testing.T) {
32 for _, tc := range []struct {

Callers

nothing calls this directly

Calls 3

AddMethod · 0.65
WriteHeaderMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected