keep reading the docs

This commit is contained in:
zicla
2019-04-12 19:21:08 +08:00
parent 8edb7833a8
commit d3a2ba9837
8 changed files with 130 additions and 23 deletions

View File

@ -77,7 +77,7 @@ func (this *DavController) HandleRoutes(writer http.ResponseWriter, request *htt
path := request.URL.Path
//匹配 /api/webdav{subPath}
//匹配 /api/dav{subPath}
reg := regexp.MustCompile(`^/api/dav(.*)$`)
strs := reg.FindStringSubmatch(path)
if len(strs) == 2 {
@ -90,16 +90,25 @@ func (this *DavController) HandleRoutes(writer http.ResponseWriter, request *htt
return nil, false
}
//完成系统安装
func (this *DavController) Index(writer http.ResponseWriter, request *http.Request, subPath string) {
this.logger.Info("请求访问来了:%s %s", request.RequestURI, subPath)
handler := &dav.Handler{
FileSystem: dav.Dir("/Users/fusu/d/group/golang/src/tank/tmp/dav"),
LockSystem: dav.NewMemLS(),
if request.Method == "PROPFIND1" {
this.davService.HandlePropfind(writer, request)
} else {
handler := &dav.Handler{
FileSystem: dav.Dir("/Users/fusu/d/group/golang/src/tank/tmp/dav"),
LockSystem: dav.NewMemLS(),
}
handler.ServeHTTP(writer, request)
}
handler.ServeHTTP(writer, request)
}