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

Function parseIfHeader

server/webdav/if.go:28–38  ·  view source on GitHub ↗

parseIfHeader parses the "If: foo bar" HTTP header. The httpHeader string should omit the "If:" prefix and have any "\r\n"s collapsed to a " ", as is returned by req.Header.Get("If") for a http.Request req.

(httpHeader string)

Source from the content-addressed store, hash-verified

26// should omit the "If:" prefix and have any "\r\n"s collapsed to a " ", as is
27// returned by req.Header.Get("If") for a http.Request req.
28func parseIfHeader(httpHeader string) (h ifHeader, ok bool) {
29 s := strings.TrimSpace(httpHeader)
30 switch tokenType, _, _ := lex(s); tokenType {
31 case '(':
32 return parseNoTagLists(s)
33 case angleTokenType:
34 return parseTaggedLists(s)
35 default:
36 return ifHeader{}, false
37 }
38}
39
40func parseNoTagLists(s string) (h ifHeader, ok bool) {
41 for {

Callers 2

confirmLocksMethod · 0.85
handleLockMethod · 0.85

Calls 3

lexFunction · 0.85
parseNoTagListsFunction · 0.85
parseTaggedListsFunction · 0.85

Tested by

no test coverage detected