Finish the first version of propfind.

This commit is contained in:
zicla
2019-04-20 22:21:49 +08:00
parent 0d5300abda
commit 50c025bd09
10 changed files with 438 additions and 28 deletions

View File

@ -1,6 +1,7 @@
package rest
import (
"fmt"
"net/http"
"regexp"
"tank/rest/dav"
@ -80,7 +81,8 @@ func (this *DavController) HandleRoutes(writer http.ResponseWriter, request *htt
path := request.URL.Path
//匹配 /api/dav{subPath}
reg := regexp.MustCompile(`^/api/dav(.*)$`)
pattern := fmt.Sprintf(`^%s(.*)$`, WEBDAV_PREFFIX)
reg := regexp.MustCompile(pattern)
strs := reg.FindStringSubmatch(path)
if len(strs) == 2 {
var f = func(writer http.ResponseWriter, request *http.Request) {