Skip to content

Commit

Permalink
agent: Enforce PUT for session destroy. Fixes #285.
Browse files Browse the repository at this point in the history
  • Loading branch information
armon committed Aug 19, 2014
1 parent e2118d2 commit 96648dd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions command/agent/session_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down

0 comments on commit 96648dd

Please sign in to comment.