mirror of
https://github.com/chrislusf/seaweedfs
synced 2024-09-08 10:00:37 +02:00
30 lines
564 B
Go
30 lines
564 B
Go
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)
|
|
}
|
|
}
|
|
|
|
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)
|
|
}
|
|
}
|