0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2025-01-20 22:52:58 -05:00

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