(p string)
| 42 | } |
| 43 | |
| 44 | func (h *Handler) stripPrefix(p string) (string, int, error) { |
| 45 | if h.Prefix == "" { |
| 46 | return p, http.StatusOK, nil |
| 47 | } |
| 48 | if r := strings.TrimPrefix(p, h.Prefix); len(r) < len(p) { |
| 49 | return r, http.StatusOK, nil |
| 50 | } |
| 51 | return p, http.StatusNotFound, errPrefixMismatch |
| 52 | } |
| 53 | |
| 54 | func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { |
| 55 | status, err := http.StatusBadRequest, errUnsupportedMethod |
no outgoing calls
no test coverage detected