Skip to content

Commit

Permalink
add checksum headers to the tus preflight response (#1702)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Christofas authored May 17, 2021
1 parent a28db08 commit 039f3f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/tus-preflight-headers.md
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions internal/http/services/owncloud/ocdav/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit 039f3f4

Please sign in to comment.