Skip to content

Commit

Permalink
Merge pull request #3386 from ishank011/thumbnails-download-fix
Browse files Browse the repository at this point in the history
Use the default server download protocol if spaces are not supported
  • Loading branch information
micbar committed Mar 30, 2022
2 parents cb46d5a + 2410032 commit 1140061
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelog/unreleased/thumbnails-download-fix.md
@@ -0,0 +1,3 @@
Bugfix: Use the default server download protocol if spaces are not supported

https://github.com/owncloud/ocis/pull/3386
4 changes: 4 additions & 0 deletions thumbnails/pkg/thumbnail/imgsource/cs3.go
Expand Up @@ -74,8 +74,12 @@ func (s CS3) Get(ctx context.Context, path string) (io.ReadCloser, error) {
for _, p := range rsp.Protocols {
if p.Protocol == "spaces" {
ep, tk = p.DownloadEndpoint, p.Token
break
}
}
if (ep == "" || tk == "") && len(rsp.Protocols) > 0 {
ep, tk = rsp.Protocols[0].DownloadEndpoint, rsp.Protocols[0].Token
}

httpReq, err := rhttp.NewRequest(ctx, "GET", ep, nil)
if err != nil {
Expand Down

0 comments on commit 1140061

Please sign in to comment.