staticfiles: Require method GET

Other methods are not currently implemented in the static file server
This commit is contained in:
Matthew Holt 2019-02-02 18:36:20 -07:00
parent f2491580e0
commit 4f8ff09551
No known key found for this signature in database
GPG Key ID: 2A349DD577D586A5

View File

@ -53,6 +53,9 @@ type FileServer struct {
// ServeHTTP serves static files for r according to fs's configuration.
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)
}