MCPcopy Index your code
hub / github.com/github/github-mcp-server / withReadonly

Function withReadonly

pkg/http/handler.go:158–163  ·  view source on GitHub ↗

withReadonly is middleware that sets readonly mode in the request context

(next http.Handler)

Source from the content-addressed store, hash-verified

156
157// withReadonly is middleware that sets readonly mode in the request context
158func withReadonly(next http.Handler) http.Handler {
159 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
160 ctx := ghcontext.WithReadonly(r.Context(), true)
161 next.ServeHTTP(w, r.WithContext(ctx))
162 })
163}
164
165// withToolset is middleware that extracts the toolset from the URL and sets it in the request context
166func withToolset(next http.Handler) http.Handler {

Callers

nothing calls this directly

Calls 1

ServeHTTPMethod · 0.80

Tested by

no test coverage detected