-
Notifications
You must be signed in to change notification settings - Fork 146
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
Resumable Upload: Indicate length during creation #2916
Conversation
|
Done!
For upload creation, this PR requires Content-Length and Upload-Length to be consistent:
For upload appending, we already have this text:
I think this covers all cases where Content-Length and Upload-Length mismatch. Did we miss anything else so far? |
Ah yeah, we already mentioned final size. That should do it. |
@@ -447,6 +454,10 @@ The `Upload-Complete` request and response header field indicates whether the co | |||
|
|||
The `Upload-Complete` header field MUST only be used if support by the resource is known to the client ({{feature-detection}}). | |||
|
|||
## Upload-Length | |||
|
|||
The `Upload-Length` request and response header field indicates the number of bytes to be uploaded for the corresponding upload resource, counted in bytes. The `Upload-Length` field value is an Integer. |
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.
In other parts of the document we have written down how to calculate the upload offset. Do we need something similar for Upload-Length and how it is calculated? E.g. without transfer codings.
Do we need to add something on what will happen if the client sends more data than the Upload-Length
?
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.
In other parts of the document we have written down how to calculate the upload offset. Do we need something similar for Upload-Length and how it is calculated? E.g. without transfer codings.
Done in ffbbb01.
Do we need to add something on what will happen if the client sends more data than the Upload-Length?
As mentioned in #2916 (comment), the document includes text that requires the server to stop the upload if the client exceeds its own upload length. Does that cover what you had in mind?
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.
As mentioned in #2916 (comment), the document includes text that requires the server to stop the upload if the client exceeds its own upload length. Does that cover what you had in mind?
It's not the exact case but maybe close enough? The case I mean is the client creates a file with Upload-Length: 100
and then tries to upload 200 bytes. For Content-Length
this is already handled by existing standards but given that Upload-Length
is a new header it's not explicit what should happen. The quoted part in #2916 (comment) is more about how to handle mismatches between the header values. Maybe we don't have to be explicit about such things?
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.
Added d83a56f to clarify this. Let me know if this doesn't cover what you had in mind.
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.
Perfect, thank you.
Thank you for the feedback, @smatsson and @guoye-zhang! |
This work has been merged in #2927. |
Closes #2832.
During the IETF 120 session, we saw support for a header to indicate the length during upload creation. A server can deduce the length from Content-Length, but this is not possible of chunked transfer coding is used or the upload is split across multiple requests. This PR adds the advisory
Upload-Length
header to fill this gap.