MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / stripPrefix

Method stripPrefix

server/webdav/webdav.go:44–52  ·  view source on GitHub ↗
(p string)

Source from the content-addressed store, hash-verified

42}
43
44func (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
54func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
55 status, err := http.StatusBadRequest, errUnsupportedMethod

Callers 11

confirmLocksMethod · 0.95
handleOptionsMethod · 0.95
handleGetHeadPostMethod · 0.95
handleDeleteMethod · 0.95
handlePutMethod · 0.95
handleMkcolMethod · 0.95
handleCopyMoveMethod · 0.95
handleLockMethod · 0.95
handleUnlockMethod · 0.95
handlePropfindMethod · 0.95
handleProppatchMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected