From eb9a51bced895eca36649c8288ee5df18f23b3f7 Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Fri, 16 May 2014 15:58:07 -0700 Subject: [PATCH] agent: Require PUT to SessionCreate --- command/agent/session_endpoint.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/command/agent/session_endpoint.go b/command/agent/session_endpoint.go index 8408baf94..d304312e2 100644 --- a/command/agent/session_endpoint.go +++ b/command/agent/session_endpoint.go @@ -10,6 +10,12 @@ import ( // SessionCreate is used to create a new session func (s *HTTPServer) SessionCreate(resp http.ResponseWriter, req *http.Request) (interface{}, error) { + // Mandate a PUT request + if req.Method != "PUT" { + resp.WriteHeader(405) + return nil, nil + } + // Default the session to our node + serf check args := structs.SessionRequest{ Op: structs.SessionCreate,