[#32] Remove recover from basic ACL checks
Basic ACL checker gets request field via getters that are NPE-free, therefore we don't need to worry about function invocations on nil structures. Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
4a8de3263d
commit
fc74e9b40c
1 changed files with 0 additions and 14 deletions
|
@ -297,13 +297,6 @@ func (b BasicChecker) findRequestInfo(
|
||||||
}
|
}
|
||||||
|
|
||||||
func getContainerIDFromRequest(req interface{}) (id *container.ID, err error) {
|
func getContainerIDFromRequest(req interface{}) (id *container.ID, err error) {
|
||||||
defer func() {
|
|
||||||
// if there is a NPE on get body and get address
|
|
||||||
if r := recover(); r != nil {
|
|
||||||
err = ErrMalformedRequest
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
switch v := req.(type) {
|
switch v := req.(type) {
|
||||||
case *object.GetRequest:
|
case *object.GetRequest:
|
||||||
return container.NewIDFromV2(v.GetBody().GetAddress().GetContainerID()), nil
|
return container.NewIDFromV2(v.GetBody().GetAddress().GetContainerID()), nil
|
||||||
|
@ -330,13 +323,6 @@ func getContainerIDFromRequest(req interface{}) (id *container.ID, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func getObjectOwnerFromMessage(req interface{}) (id *owner.ID, err error) {
|
func getObjectOwnerFromMessage(req interface{}) (id *owner.ID, err error) {
|
||||||
defer func() {
|
|
||||||
// if there is a NPE on get body and get address
|
|
||||||
if r := recover(); r != nil {
|
|
||||||
err = ErrMalformedRequest
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
switch v := req.(type) {
|
switch v := req.(type) {
|
||||||
case *object.PutRequest:
|
case *object.PutRequest:
|
||||||
objPart := v.GetBody().GetObjectPart()
|
objPart := v.GetBody().GetObjectPart()
|
||||||
|
|
Loading…
Reference in a new issue