MCPcopy Create free account
hub / github.com/SenseUnit/dumbproxy / handleReject

Method handleReject

auth/cert.go:88–94  ·  view source on GitHub ↗
(ctx context.Context, wr http.ResponseWriter, req *http.Request)

Source from the content-addressed store, hash-verified

86}
87
88func (auth *CertAuth) handleReject(ctx context.Context, wr http.ResponseWriter, req *http.Request) (string, bool) {
89 if auth.reject != nil {
90 return auth.reject.Validate(ctx, wr, req)
91 }
92 http.Error(wr, BAD_REQ_MSG, http.StatusBadRequest)
93 return "", false
94}
95
96func (auth *CertAuth) Validate(ctx context.Context, wr http.ResponseWriter, req *http.Request) (string, bool) {
97 if req.TLS == nil || len(req.TLS.VerifiedChains) < 1 || len(req.TLS.VerifiedChains[0]) < 1 {

Callers 1

ValidateMethod · 0.95

Calls 2

ValidateMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected