-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Return hashes of uploaded content for dav uploads #19351
Conversation
Nice :-)
|
This only returns the hash of the uploaded content so clients can detect corrupted transfers |
To give a bit more context ;)
No but you can detect it at least client side. And do something.
Adding this is tricky. Just imagine on a big instance and everybody starts to request the hash of several GB files. This could easily kill the server. Long story short. This is a step in the right direction but not the full fix at all. |
So I would upload the file, then download info of it, compare hash. That sounds a bit too complicated… Can't we adjust it so that server will compare hash and if it is not the same refuses the file to be moved and returns an error.
True. So we can reliable use this for all files, once each upload and change on server computes a hash sum? |
Keeping hashes for files stored on the server is a much more complex problem then just returning a hash from uploaded content. |
That is a next step. But a lot more complicated and not covered in this PR. |
Totally understandable.
Then I will wait until the next step, as we otherwise would implement the error handling logic on client side and then later can remove it again. |
@icewind1991 mind to fix ci so we can get this in as well? |
71ccecf
to
f9999c6
Compare
f9999c6
to
2f496c2
Compare
@tobiasKaminsky the calculated hash is part of the response of the move or put operation. No need to download the file info. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Needs a rebase due those code style changes.
hashes are set in "X-Hash-MD5", "X-Hash-SHA1" and "X-Hash-SHA256" headers. these headers are set for file uploads and the MOVE request at the end of a multipart upload. Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
2f496c2
to
57403c7
Compare
True, but still this needs to be done on client side. |
I only see it as a response header in put operation, but not in final move (of chunked upload)? |
Nevermind. I did something wrong, but now it works… |
5 similar comments
Nevermind. I did something wrong, but now it works… |
Nevermind. I did something wrong, but now it works… |
Nevermind. I did something wrong, but now it works… |
Nevermind. I did something wrong, but now it works… |
Nevermind. I did something wrong, but now it works… |
hashes are set in "X-Hash-MD5", "X-Hash-SHA1" and "X-Hash-SHA256" headers.
these headers are set for file uploads and the MOVE request at the end of a multipart upload.
cc @tobiasKaminsky