MCPcopy
hub / github.com/AlistGo/alist / parseDepth

Function parseDepth

server/webdav/webdav.go:865–875  ·  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

863//
864// These constraints are enforced by the handleXxx methods.
865func parseDepth(s string) int {
866 switch s {
867 case "0":
868 return 0
869 case "1":
870 return 1
871 case "infinity":
872 return infiniteDepth
873 }
874 return invalidDepth
875}
876
877// http://www.webdav.org/specs/rfc4918.html#status.code.extensions.to.http11
878const (

Callers 3

handleCopyMoveMethod · 0.85
handleLockMethod · 0.85
handlePropfindMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected