diff --git a/command/agent/session_endpoint.go b/command/agent/session_endpoint.go index a5c02b4df55a..760255f22cff 100644 --- a/command/agent/session_endpoint.go +++ b/command/agent/session_endpoint.go @@ -103,6 +103,12 @@ func FixupLockDelay(raw interface{}) error { // SessionDestroy is used to destroy an existing session func (s *HTTPServer) SessionDestroy(resp http.ResponseWriter, req *http.Request) (interface{}, error) { + // Mandate a PUT request + if req.Method != "PUT" { + resp.WriteHeader(405) + return nil, nil + } + args := structs.SessionRequest{ Op: structs.SessionDestroy, }