-
Notifications
You must be signed in to change notification settings - Fork 201
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
@tus/server: support Tus-Max-Size
#517
Conversation
eef69c5
to
a987021
Compare
a987021
to
dda00f0
Compare
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.
Thanks a lot!
There is still some docs missing on this new option.
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.
Thanks to @fenos, we discovered a flaw in tusd's logic around handling size limits, so I would be a bit hesitant to copying its logic for now until we fixed that bug: tus/tusd#1032
Has this code been tested extensively with requests that use Transfer-Encoding: chunked
? In these cases, no Content-Length
is set and the server must keep track of the read bytes and stop if necessary on its own.
@Acconut I've implemented the bug fix on this PR, however will test more in depth the |
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.
Some small comments + docs are missing, then we're good to go.
d0c7ef1
to
f469713
Compare
@Acconut @Murderlon I've made the following changes:
Ready for a final review 🎉 |
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.
Nice work, @fenos!
@Murderlon S3 tests are now failing with:
did you revoke the access key id? |
507948e
to
ed17203
Compare
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.
Looking great ✨ Thanks for the elaborate tests for this feature.
Only one small Q.
ed17203
to
e0ec8f1
Compare
e0ec8f1
to
d42396d
Compare
Based on the Tusd implementation, this PR implements a configurable maxSize option which will limit and validate incoming file size.
upload-length
is not higher than themaxSize
option provided.The only addition I've made is that in tusd it doesn't seem are limiting the request body to the maxSize specified.
They simply validate the upload-length header against the maxSize.
However, in this PR if the body reaches the maxSize bytes read, it will throw a 413 error and stop uploading.
Not sure about the consequences as in what happens to the part of the file that has been already uploaded?
In S3 we can set a policy to delete uncompleted multi-part but what about for fileStore?