fix method
parent
80becbb7a7
commit
0e22586e12
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue