aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2022-06-12 23:40:42 -0700
committerGitHub <noreply@github.com>2022-06-12 23:40:42 -0700
commitb22ca85fbb674c445096b739af142dbf53dbd72b (patch)
treed745c7edc976eaf9026166ef592307edd8bb002c /weed/s3api
parente437ec5a685e1bb906e7a61547c59dd6227a11a9 (diff)
parentf01dd27752c507bc99013da4502c12877aaeff26 (diff)
downloadseaweedfs-b22ca85fbb674c445096b739af142dbf53dbd72b.tar.xz
seaweedfs-b22ca85fbb674c445096b739af142dbf53dbd72b.zip
Merge pull request #3169 from shichanglin5/fix_auth
fix: When there is no access permission configured before startup, th…
Diffstat (limited to 'weed/s3api')
-rw-r--r--weed/s3api/auth_credentials.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/weed/s3api/auth_credentials.go b/weed/s3api/auth_credentials.go
index 757e3ddd9..fb23d9ce9 100644
--- a/weed/s3api/auth_credentials.go
+++ b/weed/s3api/auth_credentials.go
@@ -176,12 +176,12 @@ func (iam *IdentityAccessManagement) lookupAnonymous() (identity *Identity, foun
}
func (iam *IdentityAccessManagement) Auth(f http.HandlerFunc, action Action) http.HandlerFunc {
-
- if !iam.isEnabled() {
- return f
- }
-
return func(w http.ResponseWriter, r *http.Request) {
+ if !iam.isEnabled() {
+ f(w, r)
+ return
+ }
+
identity, errCode := iam.authRequest(r, action)
if errCode == s3err.ErrNone {
if identity != nil && identity.Name != "" {