Commit 4f8ff095 authored by Matthew Holt's avatar Matthew Holt

staticfiles: Require method GET

Other methods are not currently implemented in the static file server
parent f2491580
...@@ -53,6 +53,9 @@ type FileServer struct { ...@@ -53,6 +53,9 @@ type FileServer struct {
// ServeHTTP serves static files for r according to fs's configuration. // ServeHTTP serves static files for r according to fs's configuration.
func (fs FileServer) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) { func (fs FileServer) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) {
if r.Method != "GET" {
return http.StatusMethodNotAllowed, nil
}
return fs.serveFile(w, r) return fs.serveFile(w, r)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment