[#451] Handle lock objects using tree service

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2022-05-26 16:11:14 +03:00 committed by Alex Vanin
parent bc000f1bc4
commit dd534e8738
23 changed files with 488 additions and 520 deletions

View file

@ -4,6 +4,7 @@ import (
"encoding/xml"
"net/http"
"strconv"
"strings"
"github.com/nspcc-dev/neofs-s3-gw/api"
"github.com/nspcc-dev/neofs-s3-gw/api/data"
@ -144,7 +145,7 @@ func (h *handler) DeleteObjectHandler(w http.ResponseWriter, r *http.Request) {
func isErrObjectLocked(err error) bool {
switch err.(type) {
default:
return false
return strings.Contains(err.Error(), "object is locked")
case apistatus.ObjectLocked,
*apistatus.ObjectLocked:
return true