agent: Require PUT to SessionCreate

This commit is contained in:
Armon Dadgar 2014-05-16 15:58:07 -07:00
parent 9470f9a5a2
commit eb9a51bced
1 changed files with 6 additions and 0 deletions

View File

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