diff --git a/changelog/unreleased/tus-preflight-headers.md b/changelog/unreleased/tus-preflight-headers.md new file mode 100644 index 0000000000..465b2d7c63 --- /dev/null +++ b/changelog/unreleased/tus-preflight-headers.md @@ -0,0 +1,6 @@ +Enhancement: Add checksum headers to tus preflight responses + +Added `checksum` to the header `Tus-Extension` and added the `Tus-Checksum-Algorithm` header. + +https://github.com/owncloud/ocis/issues/1747 +https://github.com/cs3org/reva/pull/1702 diff --git a/internal/http/services/owncloud/ocdav/options.go b/internal/http/services/owncloud/ocdav/options.go index 9fa98d5396..d86a5afaa1 100644 --- a/internal/http/services/owncloud/ocdav/options.go +++ b/internal/http/services/owncloud/ocdav/options.go @@ -39,7 +39,8 @@ func (s *svc) handleOptions(w http.ResponseWriter, r *http.Request, ns string) { w.Header().Add("Access-Control-Expose-Headers", "Tus-Resumable, Tus-Version, Tus-Extension") w.Header().Set("Tus-Resumable", "1.0.0") // TODO(jfd): only for dirs? w.Header().Set("Tus-Version", "1.0.0") - w.Header().Set("Tus-Extension", "creation,creation-with-upload") + w.Header().Set("Tus-Extension", "creation,creation-with-upload,checksum") + w.Header().Set("Tus-Checksum-Algorithm", "md5,sha1,crc32") } - w.WriteHeader(http.StatusOK) + w.WriteHeader(http.StatusNoContent) }