mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Merge pull request #694 from himyxia/inprove_switch_case
better way to handler switch case
This commit is contained in:
commit
7e76a7d21b
|
@ -23,19 +23,13 @@ security settings:
|
||||||
|
|
||||||
func (vs *VolumeServer) privateStoreHandler(w http.ResponseWriter, r *http.Request) {
|
func (vs *VolumeServer) privateStoreHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
switch r.Method {
|
switch r.Method {
|
||||||
case "GET":
|
case "GET", "HEAD":
|
||||||
stats.ReadRequest()
|
|
||||||
vs.GetOrHeadHandler(w, r)
|
|
||||||
case "HEAD":
|
|
||||||
stats.ReadRequest()
|
stats.ReadRequest()
|
||||||
vs.GetOrHeadHandler(w, r)
|
vs.GetOrHeadHandler(w, r)
|
||||||
case "DELETE":
|
case "DELETE":
|
||||||
stats.DeleteRequest()
|
stats.DeleteRequest()
|
||||||
vs.guard.WhiteList(vs.DeleteHandler)(w, r)
|
vs.guard.WhiteList(vs.DeleteHandler)(w, r)
|
||||||
case "PUT":
|
case "PUT", "POST":
|
||||||
stats.WriteRequest()
|
|
||||||
vs.guard.WhiteList(vs.PostHandler)(w, r)
|
|
||||||
case "POST":
|
|
||||||
stats.WriteRequest()
|
stats.WriteRequest()
|
||||||
vs.guard.WhiteList(vs.PostHandler)(w, r)
|
vs.guard.WhiteList(vs.PostHandler)(w, r)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue