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

Emit OC-Etag #1067

Merged
merged 4 commits into from
May 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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