fix method

master
Bel LaPointe 2021-04-20 06:27:57 -05:00
parent 80becbb7a7
commit 0e22586e12
1 changed files with 4 additions and 0 deletions

View File

@ -119,6 +119,10 @@ func (s *Server) static(w http.ResponseWriter, r *http.Request) {
}
func (s *Server) _static(w http.ResponseWriter, r *http.Request) error {
if r.Method != http.MethodGet {
http.FileServer(s.fileDir).ServeHTTP(w, r)
return nil
}
f, err := s.fileDir.Open(path.Clean(r.URL.Path))
if err != nil {
return err