mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-25 09:40:13 +08:00
staticfiles: Require method GET
Other methods are not currently implemented in the static file server
This commit is contained in:
parent
f2491580e0
commit
4f8ff09551
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user