diff options
author | ache <ache@ache.one> | 2019-09-25 13:54:01 +0200 |
---|---|---|
committer | ache <ache@ache.one> | 2019-09-25 13:54:01 +0200 |
commit | 7003bb71e69d81b0c248ee37d39966661f9fedd6 (patch) | |
tree | 3fcebae4203fbf8f6a616ad0896dced614f973fc | |
parent | Config hosts (diff) |
Add handlePropfind
-rw-r--r-- | server.go | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -16,6 +16,7 @@ import ( ) var tmpl *template.Template; +var tmplXML *template.Template; func verifyEmptyBody( w http.ResponseWriter, r *http.Request) error { // 8.4 RFC4918 - Must return 415 (Unsupported Media Type) if body and should not. @@ -31,7 +32,7 @@ func verifyEmptyBody( w http.ResponseWriter, r *http.Request) error { return nil } func encodeURL( urlStr string ) string { - url,err := url.Parse("http://localhost" + urlStr) + url, err := url.Parse("http://localhost" + urlStr) if err == nil { return url.RequestURI() } @@ -262,7 +263,6 @@ func handleOptions( w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK); } func handleCopy( w http.ResponseWriter, r *http.Request) { - fmt.Println("The body of the request isn't empty. It should be.") } func handleMove( w http.ResponseWriter, r *http.Request) { @@ -338,6 +338,9 @@ func handleMove( w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusCreated) } } +func handlePropfind( w http.ResponseWriter, r *http.Request) { + +} func handleMethod( w http.ResponseWriter, r *http.Request) { switch r.Method { @@ -360,6 +363,8 @@ func handleMethod( w http.ResponseWriter, r *http.Request) { fallthrough case "UNLOCK": fallthrough + case "PROPFIND": + handlePropfind(w, r) case http.MethodPost: w.WriteHeader(http.StatusTeapot) fmt.Fprintln(w, "Sry, will be implemented \"soon\"") @@ -416,6 +421,7 @@ func main() { "formatSize": normaliseSize, } tmpl = template.Must(template.New("dir.html").Funcs(fmap).ParseFiles("dir.html")) + tmplXML = template.Must(template.New("xml.tmpl").Funcs(fmap).ParseFiles("xml.tmpl")) baseWd,_ := os.Getwd(); |