Skip to content

Commit

Permalink
ais: pass original request to HeadObj
Browse files Browse the repository at this point in the history
Signed-off-by: Janusz Marcinkiewicz <[email protected]>
  • Loading branch information
VirrageS committed Jul 9, 2024
1 parent 771ff60 commit 5efbfcd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions ais/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -1014,18 +1014,18 @@ func (t *target) httpobjhead(w http.ResponseWriter, r *http.Request, apireq *api
}
}
lom := core.AllocLOM(objName)
ecode, err := t.objHead(w.Header(), query, bck, lom)
ecode, err := t.objHead(r, w.Header(), query, bck, lom)
core.FreeLOM(lom)
if err != nil {
t._erris(w, r, cos.IsParseBool(query.Get(apc.QparamSilent)), err, ecode)
}
}

func (t *target) objHead(hdr http.Header, query url.Values, bck *meta.Bck, lom *core.LOM) (ecode int, err error) {
func (t *target) objHead(r *http.Request, hdr http.Header, query url.Values, bck *meta.Bck, lom *core.LOM) (ecode int, err error) {
var (
fltPresence int
exists = true
hasEC bool
exists = true
)
if tmp := query.Get(apc.QparamFltPresence); tmp != "" {
var erp error
Expand Down Expand Up @@ -1098,7 +1098,7 @@ func (t *target) objHead(hdr http.Header, query url.Values, bck *meta.Bck, lom *
} else {
// cold HEAD
var oa *cmn.ObjAttrs
oa, ecode, err = t.Backend(lom.Bck()).HeadObj(context.Background(), lom, nil /*origReq*/)
oa, ecode, err = t.Backend(lom.Bck()).HeadObj(context.Background(), lom, r)
if err != nil {
if ecode != http.StatusNotFound {
err = cmn.NewErrFailedTo(t, "HEAD", lom.Cname(), err)
Expand Down
2 changes: 1 addition & 1 deletion ais/tgtetl.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ func (t *target) headObjectETL(w http.ResponseWriter, r *http.Request) {
}

lom := core.AllocLOM(objName)
ecode, err := t.objHead(w.Header(), r.URL.Query(), bck, lom)
ecode, err := t.objHead(r, w.Header(), r.URL.Query(), bck, lom)
core.FreeLOM(lom)
if err != nil {
// always silent (compare w/ httpobjhead)
Expand Down

0 comments on commit 5efbfcd

Please sign in to comment.