diff --git a/agent/acl_endpoint.go b/agent/acl_endpoint.go index a61cdcd730..f88cc347fa 100644 --- a/agent/acl_endpoint.go +++ b/agent/acl_endpoint.go @@ -51,7 +51,7 @@ func (s *HTTPServer) ACLBootstrap(resp http.ResponseWriter, req *http.Request) ( func (s *HTTPServer) ACLDestroy(resp http.ResponseWriter, req *http.Request) (interface{}, error) { // Mandate a PUT request if req.Method != "PUT" { - resp.WriteHeader(405) + resp.WriteHeader(http.StatusMethodNotAllowed) // 405 return nil, nil } @@ -87,7 +87,7 @@ func (s *HTTPServer) ACLUpdate(resp http.ResponseWriter, req *http.Request) (int func (s *HTTPServer) aclSet(resp http.ResponseWriter, req *http.Request, update bool) (interface{}, error) { // Mandate a PUT request if req.Method != "PUT" { - resp.WriteHeader(405) + resp.WriteHeader(http.StatusMethodNotAllowed) // 405 return nil, nil } @@ -130,7 +130,7 @@ func (s *HTTPServer) aclSet(resp http.ResponseWriter, req *http.Request, update func (s *HTTPServer) ACLClone(resp http.ResponseWriter, req *http.Request) (interface{}, error) { // Mandate a PUT request if req.Method != "PUT" { - resp.WriteHeader(405) + resp.WriteHeader(http.StatusMethodNotAllowed) // 405 return nil, nil } diff --git a/agent/agent_endpoint.go b/agent/agent_endpoint.go index 37bf8a91ca..7d4a3c7572 100644 --- a/agent/agent_endpoint.go +++ b/agent/agent_endpoint.go @@ -384,7 +384,7 @@ type checkUpdate struct { // APIs. func (s *HTTPServer) AgentCheckUpdate(resp http.ResponseWriter, req *http.Request) (interface{}, error) { if req.Method != "PUT" { - resp.WriteHeader(405) + resp.WriteHeader(http.StatusMethodNotAllowed) // 405 return nil, nil } @@ -530,7 +530,7 @@ func (s *HTTPServer) AgentDeregisterService(resp http.ResponseWriter, req *http. func (s *HTTPServer) AgentServiceMaintenance(resp http.ResponseWriter, req *http.Request) (interface{}, error) { // Only PUT supported if req.Method != "PUT" { - resp.WriteHeader(405) + resp.WriteHeader(http.StatusMethodNotAllowed) // 405 return nil, nil } @@ -586,7 +586,7 @@ func (s *HTTPServer) AgentServiceMaintenance(resp http.ResponseWriter, req *http func (s *HTTPServer) AgentNodeMaintenance(resp http.ResponseWriter, req *http.Request) (interface{}, error) { // Only PUT supported if req.Method != "PUT" { - resp.WriteHeader(405) + resp.WriteHeader(http.StatusMethodNotAllowed) // 405 return nil, nil } @@ -629,7 +629,7 @@ func (s *HTTPServer) AgentNodeMaintenance(resp http.ResponseWriter, req *http.Re func (s *HTTPServer) AgentMonitor(resp http.ResponseWriter, req *http.Request) (interface{}, error) { // Only GET supported. if req.Method != "GET" { - resp.WriteHeader(405) + resp.WriteHeader(http.StatusMethodNotAllowed) // 405 return nil, nil } diff --git a/agent/event_endpoint.go b/agent/event_endpoint.go index 15f0d7a053..1bb69a60b7 100644 --- a/agent/event_endpoint.go +++ b/agent/event_endpoint.go @@ -22,7 +22,7 @@ const ( func (s *HTTPServer) EventFire(resp http.ResponseWriter, req *http.Request) (interface{}, error) { // Mandate a PUT request if req.Method != "PUT" { - resp.WriteHeader(405) + resp.WriteHeader(http.StatusMethodNotAllowed) // 405 return nil, nil } diff --git a/agent/kvs_endpoint.go b/agent/kvs_endpoint.go index 86f2f9766b..1056b40a9a 100644 --- a/agent/kvs_endpoint.go +++ b/agent/kvs_endpoint.go @@ -48,7 +48,7 @@ func (s *HTTPServer) KVSEndpoint(resp http.ResponseWriter, req *http.Request) (i case "DELETE": return s.KVSDelete(resp, req, &args) default: - resp.WriteHeader(405) + resp.WriteHeader(http.StatusMethodNotAllowed) // 405 return nil, nil } } diff --git a/agent/prepared_query_endpoint.go b/agent/prepared_query_endpoint.go index 1f4f6976c4..47d71f3a53 100644 --- a/agent/prepared_query_endpoint.go +++ b/agent/prepared_query_endpoint.go @@ -71,7 +71,7 @@ func (s *HTTPServer) PreparedQueryGeneral(resp http.ResponseWriter, req *http.Re return s.preparedQueryList(resp, req) default: - resp.WriteHeader(405) + resp.WriteHeader(http.StatusMethodNotAllowed) // 405 return nil, nil } } @@ -261,7 +261,7 @@ func (s *HTTPServer) PreparedQuerySpecific(resp http.ResponseWriter, req *http.R return s.preparedQueryDelete(id, resp, req) default: - resp.WriteHeader(405) + resp.WriteHeader(http.StatusMethodNotAllowed) // 405 return nil, nil } } diff --git a/agent/session_endpoint.go b/agent/session_endpoint.go index ae453e06cc..21858da07a 100644 --- a/agent/session_endpoint.go +++ b/agent/session_endpoint.go @@ -29,7 +29,7 @@ type sessionCreateResponse struct { func (s *HTTPServer) SessionCreate(resp http.ResponseWriter, req *http.Request) (interface{}, error) { // Mandate a PUT request if req.Method != "PUT" { - resp.WriteHeader(405) + resp.WriteHeader(http.StatusMethodNotAllowed) // 405 return nil, nil } @@ -109,7 +109,7 @@ func FixupLockDelay(raw 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) + resp.WriteHeader(http.StatusMethodNotAllowed) // 405 return nil, nil } @@ -138,7 +138,7 @@ func (s *HTTPServer) SessionDestroy(resp http.ResponseWriter, req *http.Request) func (s *HTTPServer) SessionRenew(resp http.ResponseWriter, req *http.Request) (interface{}, error) { // Mandate a PUT request if req.Method != "PUT" { - resp.WriteHeader(405) + resp.WriteHeader(http.StatusMethodNotAllowed) // 405 return nil, nil }