MCPcopy Index your code
hub / github.com/Monibuca/engine / logHandler

Method logHandler

plugin.go:81–88  ·  view source on GitHub ↗
(pattern string, handler http.Handler)

Source from the content-addressed store, hash-verified

79}
80
81func (opt *Plugin) logHandler(pattern string, handler http.Handler) http.Handler {
82 return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
83 opt.Debug("visit", zap.String("path", r.URL.String()), zap.String("remote", r.RemoteAddr))
84 name := strings.ToLower(opt.Name)
85 r.URL.Path = strings.TrimPrefix(r.URL.Path, "/"+name)
86 handler.ServeHTTP(rw, r)
87 })
88}
89func (opt *Plugin) handle(pattern string, handler http.Handler) {
90 if opt == nil {
91 return

Callers 1

handleMethod · 0.95

Calls 3

ServeHTTPMethod · 0.80
DebugMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected