diff --git a/api/handler/util.go b/api/handler/util.go index 04f9d57..6d069dd 100644 --- a/api/handler/util.go +++ b/api/handler/util.go @@ -10,16 +10,15 @@ import ( "github.com/nspcc-dev/neofs-s3-gw/api/data" "github.com/nspcc-dev/neofs-s3-gw/api/errors" "github.com/nspcc-dev/neofs-s3-gw/api/layer" - "github.com/nspcc-dev/neofs-s3-gw/internal/misc" "github.com/nspcc-dev/neofs-sdk-go/session" "go.uber.org/zap" ) func (h *handler) logAndSendError(w http.ResponseWriter, logText string, reqInfo *api.ReqInfo, err error, additional ...zap.Field) { - fields := []zap.Field{zap.String("request_id", misc.SanitizeString(reqInfo.RequestID)), - zap.String("method", misc.SanitizeString(reqInfo.API)), - zap.String("bucket_name", misc.SanitizeString(reqInfo.BucketName)), - zap.String("object_name", misc.SanitizeString(reqInfo.ObjectName)), + fields := []zap.Field{zap.String("request_id", reqInfo.RequestID), + zap.String("method", reqInfo.API), + zap.String("bucket_name", reqInfo.BucketName), + zap.String("object_name", reqInfo.ObjectName), zap.Error(err)} fields = append(fields, additional...) diff --git a/api/layer/multipart_upload.go b/api/layer/multipart_upload.go index ddc42c7..8a1c9c9 100644 --- a/api/layer/multipart_upload.go +++ b/api/layer/multipart_upload.go @@ -13,7 +13,6 @@ import ( "github.com/nspcc-dev/neofs-s3-gw/api/data" "github.com/nspcc-dev/neofs-s3-gw/api/errors" - "github.com/nspcc-dev/neofs-s3-gw/internal/misc" oid "github.com/nspcc-dev/neofs-sdk-go/object/id" "github.com/nspcc-dev/neofs-sdk-go/user" "go.uber.org/zap" @@ -391,7 +390,7 @@ func (n *layer) CompleteMultipartUpload(ctx context.Context, p *CompleteMultipar }) if err != nil { n.log.Error("could not put a completed object (multipart upload)", - zap.String("uploadID", misc.SanitizeString(p.Info.UploadID)), + zap.String("uploadID", p.Info.UploadID), zap.String("uploadKey", p.Info.Key), zap.Error(err)) diff --git a/internal/misc/sanitizer.go b/internal/misc/sanitizer.go deleted file mode 100644 index ea2e7f5..0000000 --- a/internal/misc/sanitizer.go +++ /dev/null @@ -1,9 +0,0 @@ -package misc - -import "strings" - -// SanitizeString sanitizes string before using it in logs. Required -// for data from the user input: request body, headers, etc. -func SanitizeString(s string) string { - return strings.Replace(s, "\n", "", -1) -}