Skip to content

Commit

Permalink
Set oc fileid header (#3458)
Browse files Browse the repository at this point in the history
* Set the Oc-Fileid header when copying items

* Add changelog
  • Loading branch information
aduffeck authored Nov 14, 2022
1 parent cd24894 commit 3dbdcc5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/set-oc-fileid-header.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Set the Oc-Fileid header when copying items

We added the Oc-Fileid header in the COPY response for compatibility reasons.

https://github.com/cs3org/reva/pull/3458
https://github.com/owncloud/ocis/issues/5039
7 changes: 7 additions & 0 deletions internal/http/services/owncloud/ocdav/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ func (s *svc) executePathCopy(ctx context.Context, client gateway.GatewayAPIClie
return err
}

if fileid := httpUploadRes.Header.Get(net.HeaderOCFileID); fileid != "" {
w.Header().Set(net.HeaderOCFileID, fileid)
}
}
return nil
}
Expand Down Expand Up @@ -468,6 +471,10 @@ func (s *svc) executeSpacesCopy(ctx context.Context, w http.ResponseWriter, clie
if httpUploadRes.StatusCode != http.StatusOK {
return err
}

if fileid := httpUploadRes.Header.Get(net.HeaderOCFileID); fileid != "" {
w.Header().Set(net.HeaderOCFileID, fileid)
}
}
return nil
}
Expand Down

0 comments on commit 3dbdcc5

Please sign in to comment.