agent: Require PUT to SessionCreate
This commit is contained in:
parent
9470f9a5a2
commit
eb9a51bced
|
@ -10,6 +10,12 @@ import (
|
||||||
|
|
||||||
// SessionCreate is used to create a new session
|
// SessionCreate is used to create a new session
|
||||||
func (s *HTTPServer) SessionCreate(resp http.ResponseWriter, req *http.Request) (interface{}, error) {
|
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
|
// Default the session to our node + serf check
|
||||||
args := structs.SessionRequest{
|
args := structs.SessionRequest{
|
||||||
Op: structs.SessionCreate,
|
Op: structs.SessionCreate,
|
||||||
|
|
Loading…
Reference in New Issue