aboutsummaryrefslogtreecommitdiff
path: root/weed/iamapi
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-10-31 18:05:34 -0700
committerChris Lu <chris.lu@gmail.com>2021-10-31 18:05:34 -0700
commitf17fa400d59a123ddfa76d1aac1d701d7b19e951 (patch)
tree8eeed582bf932a0d2f5d1e1f72857edd3efb5831 /weed/iamapi
parent006b4ec0f8ebdd0964e412fdf5f327284d838443 (diff)
downloadseaweedfs-f17fa400d59a123ddfa76d1aac1d701d7b19e951.tar.xz
seaweedfs-f17fa400d59a123ddfa76d1aac1d701d7b19e951.zip
refactoring
Diffstat (limited to 'weed/iamapi')
-rw-r--r--weed/iamapi/iamapi_management_handlers.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/weed/iamapi/iamapi_management_handlers.go b/weed/iamapi/iamapi_management_handlers.go
index 74733a799..e8092020b 100644
--- a/weed/iamapi/iamapi_management_handlers.go
+++ b/weed/iamapi/iamapi_management_handlers.go
@@ -362,7 +362,7 @@ func (iama *IamApiServer) DeleteAccessKey(s3cfg *iam_pb.S3ApiConfiguration, valu
func (iama *IamApiServer) DoActions(w http.ResponseWriter, r *http.Request) {
if err := r.ParseForm(); err != nil {
- s3err.WriteErrorResponse(w, s3err.ErrInvalidRequest, r)
+ s3err.WriteErrorResponse(w, r, s3err.ErrInvalidRequest)
return
}
values := r.PostForm
@@ -370,7 +370,7 @@ func (iama *IamApiServer) DoActions(w http.ResponseWriter, r *http.Request) {
s3cfgLock.RLock()
s3cfg := &iam_pb.S3ApiConfiguration{}
if err := iama.s3ApiConfig.GetS3ApiConfiguration(s3cfg); err != nil {
- s3err.WriteErrorResponse(w, s3err.ErrInternalError, r)
+ s3err.WriteErrorResponse(w, r, s3err.ErrInternalError)
return
}
s3cfgLock.RUnlock()
@@ -411,14 +411,14 @@ func (iama *IamApiServer) DoActions(w http.ResponseWriter, r *http.Request) {
response, err = iama.CreatePolicy(s3cfg, values)
if err != nil {
glog.Errorf("CreatePolicy: %+v", err)
- s3err.WriteErrorResponse(w, s3err.ErrInvalidRequest, r)
+ s3err.WriteErrorResponse(w, r, s3err.ErrInvalidRequest)
return
}
case "PutUserPolicy":
response, err = iama.PutUserPolicy(s3cfg, values)
if err != nil {
glog.Errorf("PutUserPolicy: %+v", err)
- s3err.WriteErrorResponse(w, s3err.ErrInvalidRequest, r)
+ s3err.WriteErrorResponse(w, r, s3err.ErrInvalidRequest)
return
}
case "GetUserPolicy":