fix S3 per-user-directory Policy (#6443)

* fix S3 per-user-directory Policy

* Delete docker/config.json

* add tests

* remove logs

* undo modifications of weed/shell/command_volume_balance.go

* remove modifications of docker-compose

* fix failing test

---------

Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
This commit is contained in:
Tom Crasset
2025-01-17 10:03:17 +01:00
committed by GitHub
parent eab2e0e112
commit c5f21b2b01
7 changed files with 404 additions and 18 deletions

View File

@@ -17,9 +17,10 @@
package s3_constants
import (
"github.com/gorilla/mux"
"net/http"
"strings"
"github.com/gorilla/mux"
)
// Standard S3 HTTP request constants
@@ -72,6 +73,16 @@ func GetBucketAndObject(r *http.Request) (bucket, object string) {
return
}
func GetPrefix(r *http.Request) string {
query := r.URL.Query()
prefix := query.Get("prefix")
if !strings.HasPrefix(prefix, "/") {
prefix = "/" + prefix
}
return prefix
}
var PassThroughHeaders = map[string]string{
"response-cache-control": "Cache-Control",
"response-content-disposition": "Content-Disposition",