Skip to content
This repository was archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1067 from owncloud/emit-oc-etag
Browse files Browse the repository at this point in the history
Emit OC-Etag
  • Loading branch information
Jan authored May 12, 2022
2 parents 8cdaa63 + 60bae17 commit 370e089
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/enhancement-send-oc-etag
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: send oc-etag on putFileContents and getFileContents methods

Due to server encoding, the ETag might differ from OC-ETag, therefore we emit both.

https://github.com/owncloud/owncloud-sdk/pull/1067
2 changes: 2 additions & 0 deletions src/fileManagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class Files {
body: body,
headers: {
ETag: response.headers.get('etag'),
'OC-ETag': response.headers.get('oc-etag'),
'OC-FileId': response.headers.get('oc-fileid')
}
})
Expand Down Expand Up @@ -172,6 +173,7 @@ class Files {
if ([200, 201, 204, 207].indexOf(result.status) > -1) {
return Promise.resolve({
ETag: result.res.headers.etag,
'OC-ETag': result.res.headers['oc-etag'],
'OC-FileId': result.res.headers['oc-fileid']
})
} else {
Expand Down

0 comments on commit 370e089

Please sign in to comment.