-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PATCH request for TUS upload with wrong checksum gives incorrect response #1755
Comments
tested on |
@micbar @butonic @aduffeck There are few points for discussion:
|
Yes, we need to switch to v2 version if we want this fixed. See accurate description of the problem here: https://github.com/cs3org/reva/blob/edge/pkg/storage/utils/decomposedfs/upload/upload.go#L68-L71 (tusd v1 simply doesn't support it...) |
How do we continue here? Do we update to version 2? What is the downside? |
v2 has landed on master. I'll try making progress here next week 👍 |
Tried to add support for chunk based checksum checking here cs3org/reva#4807 but we hit several walls. A) Mixed checksum format during test. B) Breaking bug in tus-php package We could get pass A by adjusting all tests. But B is breaking as we cannot control it. We have two options: fix it upstream (if possible) or switch to different tus package for php tests. |
There does not seem to be another up to date php tus client library: https://tus.io/implementations |
Describe the bug
According to the TUS checksum extension description in https://tus.io/protocols/resumable-upload.html#checksum when a
PATCH
request is send with anUpload-Checksum
header depending on the result the server may respond with one of the following status code:1.
400 Bad Request
if the checksum algorithm is not supported by the server2.
460 Checksum Mismatch
if the checksums mismatch3.
204 No Content
if the checksums match and the processing of the data succeededBut when we send
PATCH
request with wrong checksum then instead of460 Checksum Mismatch
we get204 No Content
Steps to reproduce
Steps to reproduce the behavior:
echo -n "textFile.txt" | base64
(example dGV4dEZpbGUudHh0)POST
request to create resource which will give a resource location url.PATCH
request to upload data to the location url along with a wrong checkumFor example: correct sha1sum for '12345' is
8cb2237d0679ca88db6464eac60da96345513964
but we are sending wrong value i.e.01b307acba4f54f55aafc33bb06bbbf6ca803e9a
:Expected behavior
Actual behavior
While doing
PROPFIND
it can be seen that the filetextFile.txt
has been created and it gives the correct checksum and ignores the incorrect checksum send duringPATCH
request.The text was updated successfully, but these errors were encountered: