diff --git a/weed/s3api/s3tables/handler.go b/weed/s3api/s3tables/handler.go index 982b78b28..dbe664abf 100644 --- a/weed/s3api/s3tables/handler.go +++ b/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 // the caller identity and ownership verification when IAM is enabled. 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 != "" { return accountID }