agent: Enforce PUT for session destroy. Fixes #285.

This commit is contained in:
Armon Dadgar 2014-08-19 10:53:25 -07:00
parent de89031c1a
commit ee614ace35

View file

@ -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,
}