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

Function parseDepth

server/webdav/webdav.go:881–891  ·  view source on GitHub ↗

parseDepth maps the strings "0", "1" and "infinity" to 0, 1 and infiniteDepth. Parsing any other string returns invalidDepth. Different WebDAV methods have further constraints on valid depths: - PROPFIND has no further restrictions, as per section 9.1. - COPY accepts only "0" or "infinity", as per

(s string)

Source from the content-addressed store, hash-verified

879//
880// These constraints are enforced by the handleXxx methods.
881func parseDepth(s string) int {
882 switch s {
883 case "0":
884 return 0
885 case "1":
886 return 1
887 case "infinity":
888 return infiniteDepth
889 }
890 return invalidDepth
891}
892
893// http://www.webdav.org/specs/rfc4918.html#status.code.extensions.to.http11
894const (

Callers 3

handleCopyMoveMethod · 0.85
handleLockMethod · 0.85
handlePropfindMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected