filer_server_handlers.go 564 B

1234567891011121314151617181920212223242526272829
  1. package weed_server
  2. import (
  3. "net/http"
  4. )
  5. func (fs *FilerServer) filerHandler(w http.ResponseWriter, r *http.Request) {
  6. switch r.Method {
  7. case "GET":
  8. fs.GetOrHeadHandler(w, r, true)
  9. case "HEAD":
  10. fs.GetOrHeadHandler(w, r, false)
  11. case "DELETE":
  12. fs.DeleteHandler(w, r)
  13. case "PUT":
  14. fs.PostHandler(w, r)
  15. case "POST":
  16. fs.PostHandler(w, r)
  17. }
  18. }
  19. func (fs *FilerServer) readonlyFilerHandler(w http.ResponseWriter, r *http.Request) {
  20. switch r.Method {
  21. case "GET":
  22. fs.GetOrHeadHandler(w, r, true)
  23. case "HEAD":
  24. fs.GetOrHeadHandler(w, r, false)
  25. }
  26. }