mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-08 02:25:34 +08:00
GET to POST for v1/profiles endpoint (#523)
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 getProfilesEndpoint endpoint.Endpoint
|
||||
{
|
||||
getProfilesEndpoint = httptransport.NewClient(
|
||||
"GET",
|
||||
"POST",
|
||||
httputil.CopyURL(u, "/v1/profiles"),
|
||||
httputil.EncodeRequestWithToken(token, httptransport.EncodeJSONRequest),
|
||||
decodeGetProfilesResponse,
|
||||
|
||||
@@ -22,11 +22,11 @@ func MakeServerEndpoints(s Service, outer endpoint.Middleware, others ...endpoin
|
||||
}
|
||||
|
||||
func RegisterHTTPHandlers(r *mux.Router, e Endpoints, options ...httptransport.ServerOption) {
|
||||
// GET /v1/profiles get a list of profiles managed by the server
|
||||
// POST /v1/profiles get a list of profiles managed by the server
|
||||
// PUT /v1/profiles create or replace a profile on the server
|
||||
// DELETE /v1/profiles remove one or more profiles from the server
|
||||
|
||||
r.Methods("GET").Path("/v1/profiles").Handler(httptransport.NewServer(
|
||||
r.Methods("POST").Path("/v1/profiles").Handler(httptransport.NewServer(
|
||||
e.GetProfilesEndpoint,
|
||||
decodeGetProfilesRequest,
|
||||
httputil.EncodeJSONResponse,
|
||||
|
||||
Reference in New Issue
Block a user