agent: Enforce PUT for session destroy. Fixes #285.
This commit is contained in:
parent
de89031c1a
commit
ee614ace35
|
@ -103,6 +103,12 @@ func FixupLockDelay(raw interface{}) error {
|
||||||
|
|
||||||
// SessionDestroy is used to destroy an existing session
|
// SessionDestroy is used to destroy an existing session
|
||||||
func (s *HTTPServer) SessionDestroy(resp http.ResponseWriter, req *http.Request) (interface{}, error) {
|
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{
|
args := structs.SessionRequest{
|
||||||
Op: structs.SessionDestroy,
|
Op: structs.SessionDestroy,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue