diff options
| author | Konstantin Lebedev <lebedev_k@tochka.com> | 2021-12-07 12:15:48 +0500 |
|---|---|---|
| committer | Konstantin Lebedev <lebedev_k@tochka.com> | 2021-12-07 12:15:48 +0500 |
| commit | 4ec8715f2064994450ae8918b527db0d0c8da76c (patch) | |
| tree | f06743ca0dd6b22f31f5116256e436f630673bcc /weed/s3api/http | |
| parent | 3ac48cd5402d6f16e94e34dcc21b2085d44faa21 (diff) | |
| download | seaweedfs-4ec8715f2064994450ae8918b527db0d0c8da76c.tar.xz seaweedfs-4ec8715f2064994450ae8918b527db0d0c8da76c.zip | |
audit log
Diffstat (limited to 'weed/s3api/http')
| -rw-r--r-- | weed/s3api/http/header.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/weed/s3api/http/header.go b/weed/s3api/http/header.go index 6614b0af0..7579cf312 100644 --- a/weed/s3api/http/header.go +++ b/weed/s3api/http/header.go @@ -16,6 +16,12 @@ package http +import ( + "github.com/gorilla/mux" + "net/http" + "strings" +) + // Standard S3 HTTP request constants const ( // S3 storage class @@ -34,3 +40,14 @@ const ( AmzIdentityId = "s3-identity-id" AmzIsAdmin = "s3-is-admin" // only set to http request header as a context ) + +func GetBucketAndObject(r *http.Request) (bucket, object string) { + vars := mux.Vars(r) + bucket = vars["bucket"] + object = vars["object"] + if !strings.HasPrefix(object, "/") { + object = "/" + object + } + + return +} |
