mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05:00
Add context to the object-interface methods.
Make necessary changes to xl fs azure sia
This commit is contained in:
committed by
kannappanr
parent
9083bc152e
commit
e452377b24
16
cmd/utils.go
16
cmd/utils.go
@@ -18,6 +18,7 @@ package cmd
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
@@ -34,6 +35,8 @@ import (
|
||||
"time"
|
||||
|
||||
humanize "github.com/dustin/go-humanize"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/minio/minio/cmd/logger"
|
||||
"github.com/pkg/profile"
|
||||
)
|
||||
|
||||
@@ -314,3 +317,16 @@ func ceilFrac(numerator, denominator int64) (ceil int64) {
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func newContext(r *http.Request, api string) context.Context {
|
||||
vars := mux.Vars(r)
|
||||
bucket := vars["bucket"]
|
||||
object := vars["object"]
|
||||
prefix := vars["prefix"]
|
||||
|
||||
if prefix != "" {
|
||||
object = prefix
|
||||
}
|
||||
|
||||
return logger.ContextSet(context.Background(), &logger.ReqInfo{r.RemoteAddr, r.Header.Get("user-agent"), "", api, bucket, object, nil})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user