Skip to content

Commit

Permalink
clean up and deduplicate webdav COPY code
Browse files Browse the repository at this point in the history
  • Loading branch information
David Christofas committed May 31, 2021
1 parent 385eff8 commit 39f4652
Show file tree
Hide file tree
Showing 7 changed files with 385 additions and 408 deletions.
10 changes: 9 additions & 1 deletion internal/grpc/services/gateway/storageprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,15 @@ func (s *svc) stat(ctx context.Context, req *provider.StatRequest) (*provider.St
Status: status.NewInternal(ctx, err, "error connecting to storage provider="+providers[0].Address),
}, nil
}
return c.Stat(ctx, req)
rsp, err := c.Stat(ctx, req)
if err != nil || rsp.Status.Code != rpc.Code_CODE_OK {
return rsp, err
}
if !isStorageSpaceReference(req.Ref) {
rsp.Info.Path = path.Join(providers[0].ProviderPath, rsp.Info.Path)
}

return rsp, nil
}

infoFromProviders := make([]*provider.ResourceInfo, len(providers))
Expand Down
Loading

0 comments on commit 39f4652

Please sign in to comment.