Browse Source
Update weed/s3api/s3tables/handler.go
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
pull/8147/head
Chris Lu
4 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
3 additions and
0 deletions
-
weed/s3api/s3tables/handler.go
|
|
@ -161,6 +161,9 @@ func (h *S3TablesHandler) HandleRequest(w http.ResponseWriter, r *http.Request, |
|
|
// This is also used as the principal for permission checks, ensuring alignment between
|
|
|
// This is also used as the principal for permission checks, ensuring alignment between
|
|
|
// the caller identity and ownership verification when IAM is enabled.
|
|
|
// the caller identity and ownership verification when IAM is enabled.
|
|
|
func (h *S3TablesHandler) getAccountID(r *http.Request) string { |
|
|
func (h *S3TablesHandler) getAccountID(r *http.Request) string { |
|
|
|
|
|
if identityName := s3_constants.GetIdentityNameFromContext(r.Context()); identityName != "" { |
|
|
|
|
|
return identityName |
|
|
|
|
|
} |
|
|
if accountID := r.Header.Get(s3_constants.AmzAccountId); accountID != "" { |
|
|
if accountID := r.Header.Get(s3_constants.AmzAccountId); accountID != "" { |
|
|
return accountID |
|
|
return accountID |
|
|
} |
|
|
} |
|
|
|