diff options
| author | Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> | 2024-07-01 13:00:39 +0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-01 01:00:39 -0700 |
| commit | 5ffacbb6eacaad6ea9558d18f9c62be2a3c4e18f (patch) | |
| tree | bf5797c6b002d953d03ae68fa37c7c4be7fabc40 /weed/iamapi | |
| parent | 0fdf7eca48892b5c6d12c1c96563755945331f16 (diff) | |
| download | seaweedfs-5ffacbb6eacaad6ea9558d18f9c62be2a3c4e18f.tar.xz seaweedfs-5ffacbb6eacaad6ea9558d18f9c62be2a3c4e18f.zip | |
refactor all methods strings to const (#5726)
Diffstat (limited to 'weed/iamapi')
| -rw-r--r-- | weed/iamapi/iamapi_server.go | 2 | ||||
| -rw-r--r-- | weed/iamapi/iamapi_test.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/weed/iamapi/iamapi_server.go b/weed/iamapi/iamapi_server.go index 3a4fb914e..d1575a14e 100644 --- a/weed/iamapi/iamapi_server.go +++ b/weed/iamapi/iamapi_server.go @@ -72,7 +72,7 @@ func (iama *IamApiServer) registerRouter(router *mux.Router) { // ListBuckets // apiRouter.Methods("GET").Path("/").HandlerFunc(track(s3a.iam.Auth(s3a.ListBucketsHandler, ACTION_ADMIN), "LIST")) - apiRouter.Methods("POST").Path("/").HandlerFunc(iama.iam.Auth(iama.DoActions, ACTION_ADMIN)) + apiRouter.Methods(http.MethodPost).Path("/").HandlerFunc(iama.iam.Auth(iama.DoActions, ACTION_ADMIN)) // // NotFound apiRouter.NotFoundHandler = http.HandlerFunc(s3err.NotFoundHandler) diff --git a/weed/iamapi/iamapi_test.go b/weed/iamapi/iamapi_test.go index efd74a059..f32e1ac51 100644 --- a/weed/iamapi/iamapi_test.go +++ b/weed/iamapi/iamapi_test.go @@ -189,7 +189,7 @@ func TestDeleteUser(t *testing.T) { func executeRequest(req *http.Request, v interface{}) (*httptest.ResponseRecorder, error) { rr := httptest.NewRecorder() apiRouter := mux.NewRouter().SkipClean(true) - apiRouter.Path("/").Methods("POST").HandlerFunc(ias.DoActions) + apiRouter.Path("/").Methods(http.MethodPost).HandlerFunc(ias.DoActions) apiRouter.ServeHTTP(rr, req) return rr, xml.Unmarshal(rr.Body.Bytes(), &v) } |
