mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-05 17:05:51 +08:00
GET to POST for v1/users endpoint (#526)
Changed GET to POST as a GET with a request body is not preferred.
This commit is contained in:
@@ -29,7 +29,7 @@ func NewHTTPClient(instance, token string, logger log.Logger, opts ...httptransp
|
||||
var listUsersEndpoint endpoint.Endpoint
|
||||
{
|
||||
listUsersEndpoint = httptransport.NewClient(
|
||||
"GET",
|
||||
"POST",
|
||||
httputil.CopyURL(u, "/v1/users"),
|
||||
httputil.EncodeRequestWithToken(token, httptransport.EncodeJSONRequest),
|
||||
decodeListUsersResponse,
|
||||
|
||||
@@ -22,7 +22,7 @@ func MakeServerEndpoints(s Service, outer endpoint.Middleware, others ...endpoin
|
||||
|
||||
func RegisterHTTPHandlers(r *mux.Router, e Endpoints, options ...httptransport.ServerOption) {
|
||||
// PUT /v1/users create or replace an user
|
||||
// GET /v1/users get a list of users managed by the server
|
||||
// POST /v1/users get a list of users managed by the server
|
||||
|
||||
r.Methods("PUT").Path("/v1/users").Handler(httptransport.NewServer(
|
||||
e.ApplyUserEndpoint,
|
||||
@@ -31,7 +31,7 @@ func RegisterHTTPHandlers(r *mux.Router, e Endpoints, options ...httptransport.S
|
||||
options...,
|
||||
))
|
||||
|
||||
r.Methods("GET").Path("/v1/users").Handler(httptransport.NewServer(
|
||||
r.Methods("POST").Path("/v1/users").Handler(httptransport.NewServer(
|
||||
e.ListUsersEndpoint,
|
||||
decodeListUsersRequest,
|
||||
httputil.EncodeJSONResponse,
|
||||
|
||||
Reference in New Issue
Block a user