diff --git a/api/api.go b/api/api.go index 94b11c0..94fc10c 100644 --- a/api/api.go +++ b/api/api.go @@ -740,8 +740,15 @@ func (h *Handler) handleGetBucket(w http.ResponseWriter, r *http.Request) { query := r.URL.Query() if query.Has("location") { - xmlResponse := ` - us-east-1` + region := "us-east-1" + if h.authSvc != nil { + candidate := strings.TrimSpace(h.authSvc.Config().Region) + if candidate != "" { + region = candidate + } + } + xmlResponse := fmt.Sprintf(` +%s`, region) w.Header().Set("Content-Type", "application/xml; charset=utf-8") w.Header().Set("Content-Length", strconv.Itoa(len(xmlResponse))) diff --git a/utils/config.go b/utils/config.go index 0191668..88c38ee 100644 --- a/utils/config.go +++ b/utils/config.go @@ -48,7 +48,7 @@ func NewConfig() *Config { MultipartCleanupRetention: time.Duration( envIntRange("MULTIPART_RETENTION_HOURS", 24, 1, 24*30), ) * time.Hour, - AuthEnabled: envBool("AUTH_ENABLED", true), + AuthEnabled: envBool("AUTH_ENABLED", false), AuthRegion: firstNonEmpty(strings.TrimSpace(os.Getenv("AUTH_REGION")), "us-east-1"), AuthSkew: time.Duration(envIntRange("AUTH_SKEW_SECONDS", 300, 30, 3600)) * time.Second, AuthMaxPresign: time.Duration(envIntRange("AUTH_MAX_PRESIGN_SECONDS", 86400, 60, 86400)) * time.Second,