mirror of
https://github.com/caddyserver/caddy.git
synced 2025-03-10 15:48:58 +01: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
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue