You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
564 B

  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. }