seaweedfs/weed/server/filer_server_handlers.go

30 lines
564 B
Go
Raw Normal View History

2014-03-30 18:28:04 +00:00
package weed_server
import (
"net/http"
)
func (fs *FilerServer) filerHandler(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case "GET":
fs.GetOrHeadHandler(w, r, true)
case "HEAD":
fs.GetOrHeadHandler(w, r, false)
case "DELETE":
fs.DeleteHandler(w, r)
case "PUT":
fs.PostHandler(w, r)
case "POST":
fs.PostHandler(w, r)
}
}
2017-05-28 03:14:22 +00:00
func (fs *FilerServer) readonlyFilerHandler(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case "GET":
fs.GetOrHeadHandler(w, r, true)
case "HEAD":
fs.GetOrHeadHandler(w, r, false)
}
}