diff --git a/internal/grpc/services/storageprovider/storageprovider.go b/internal/grpc/services/storageprovider/storageprovider.go index 52d5154415..87d280a07a 100644 --- a/internal/grpc/services/storageprovider/storageprovider.go +++ b/internal/grpc/services/storageprovider/storageprovider.go @@ -302,14 +302,9 @@ func (s *service) InitiateFileUpload(ctx context.Context, req *provider.Initiate log := appctx.GetLogger(ctx) newRef, err := s.unwrap(ctx, req.Ref) if err != nil { - switch err.(type) { - case errtypes.IsNotFound: - newRef = req.Ref - default: - return &provider.InitiateFileUploadResponse{ - Status: status.NewInternal(ctx, err, "error unwrapping path"), - }, nil - } + return &provider.InitiateFileUploadResponse{ + Status: status.NewInternal(ctx, err, "error unwrapping path"), + }, nil } if newRef.GetPath() == "/" { return &provider.InitiateFileUploadResponse{ @@ -346,7 +341,7 @@ func (s *service) InitiateFileUpload(ctx context.Context, req *provider.Initiate st = status.NewNotFound(ctx, "path not found when initiating upload") case errtypes.IsBadRequest, errtypes.IsChecksumMismatch: st = status.NewInvalidArg(ctx, err.Error()) - // TODO TUS uses a custom ChecksumMismatch 460 http status which is in an unnasigned range in + // TODO TUS uses a custom ChecksumMismatch 460 http status which is in an unassigned range in // https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml // maybe 409 conflict is good enough // someone is proposing `419 Checksum Error`, see https://stackoverflow.com/a/35665694 diff --git a/internal/http/services/owncloud/ocdav/copy.go b/internal/http/services/owncloud/ocdav/copy.go index 153601a392..8860da2e8f 100644 --- a/internal/http/services/owncloud/ocdav/copy.go +++ b/internal/http/services/owncloud/ocdav/copy.go @@ -50,7 +50,7 @@ type intermediateDirRefFunc func() (*provider.Reference, *rpc.Status, error) func (s *svc) handlePathCopy(w http.ResponseWriter, r *http.Request, ns string) { ctx := r.Context() - ctx, span := trace.StartSpan(ctx, "head") + ctx, span := trace.StartSpan(ctx, "copy") defer span.End() src := path.Join(ns, r.URL.Path) @@ -260,7 +260,7 @@ func (s *svc) executePathCopy(ctx context.Context, client gateway.GatewayAPIClie func (s *svc) handleSpacesCopy(w http.ResponseWriter, r *http.Request, spaceID string) { ctx := r.Context() - ctx, span := trace.StartSpan(ctx, "head") + ctx, span := trace.StartSpan(ctx, "spaces_copy") defer span.End() dst, err := extractDestination(r) diff --git a/internal/http/services/owncloud/ocdav/propfind.go b/internal/http/services/owncloud/ocdav/propfind.go index f77ae401e7..94f8614da0 100644 --- a/internal/http/services/owncloud/ocdav/propfind.go +++ b/internal/http/services/owncloud/ocdav/propfind.go @@ -90,7 +90,7 @@ func (s *svc) handlePathPropfind(w http.ResponseWriter, r *http.Request, ns stri func (s *svc) handleSpacesPropfind(w http.ResponseWriter, r *http.Request, spaceID string) { ctx := r.Context() - ctx, span := trace.StartSpan(ctx, "propfind") + ctx, span := trace.StartSpan(ctx, "spaces_propfind") defer span.End() sublog := appctx.GetLogger(ctx).With().Str("path", r.URL.Path).Str("spaceid", spaceID).Logger() diff --git a/internal/http/services/owncloud/ocdav/publicfile.go b/internal/http/services/owncloud/ocdav/publicfile.go index 3d06da037d..ba4cc78ee8 100644 --- a/internal/http/services/owncloud/ocdav/publicfile.go +++ b/internal/http/services/owncloud/ocdav/publicfile.go @@ -131,7 +131,7 @@ func (s *svc) adjustResourcePathInURL(w http.ResponseWriter, r *http.Request) bo // ns is the namespace that is prefixed to the path in the cs3 namespace func (s *svc) handlePropfindOnToken(w http.ResponseWriter, r *http.Request, ns string, onContainer bool) { ctx := r.Context() - ctx, span := trace.StartSpan(ctx, "propfind") + ctx, span := trace.StartSpan(ctx, "token_propfind") defer span.End() tokenStatInfo := ctx.Value(tokenStatInfoKey{}).(*provider.ResourceInfo) diff --git a/internal/http/services/owncloud/ocdav/put.go b/internal/http/services/owncloud/ocdav/put.go index 5bbee1ea24..9b8701ca3b 100644 --- a/internal/http/services/owncloud/ocdav/put.go +++ b/internal/http/services/owncloud/ocdav/put.go @@ -335,6 +335,8 @@ func (s *svc) handlePut(ctx context.Context, w http.ResponseWriter, r *http.Requ func (s *svc) handleSpacesPut(w http.ResponseWriter, r *http.Request, spaceID string) { ctx := r.Context() + ctx, span := trace.StartSpan(ctx, "spaces_put") + defer span.End() sublog := appctx.GetLogger(ctx).With().Str("spaceid", spaceID).Str("path", r.URL.Path).Logger()