parseCamliPath looks for "/camli/" in the path and returns what follows it (the action).
(path string)
| 96 | // parseCamliPath looks for "/camli/" in the path and returns |
| 97 | // what follows it (the action). |
| 98 | func parseCamliPath(path string) (action string, err error) { |
| 99 | camIdx := strings.Index(path, camliPrefix) |
| 100 | if camIdx == -1 { |
| 101 | return "", ErrCamliPath |
| 102 | } |
| 103 | action = path[camIdx+len(camliPrefix):] |
| 104 | return |
| 105 | } |
| 106 | |
| 107 | func unsupportedHandler(rw http.ResponseWriter, req *http.Request) { |
| 108 | httputil.BadRequestError(rw, "Unsupported Perkeep path or method.") |
no test coverage detected