-
Notifications
You must be signed in to change notification settings - Fork 164
Clarify when a server MUST supply an upload-length #3204
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
Conversation
- MUST include the offset in the `Upload-Offset` header field ({{upload-offset}}), | ||
- MUST include the completeless state in the `Upload-Complete` header field ({{upload-complete}}), | ||
- MUST include the length in the `Upload-Length` header field if known ({{upload-length}}), | ||
- MUST include the length in the `Upload-Length` header field unless the client has not supplied one ({{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.
The client can also specify the complete upload length implicitly through the combination of Content-Length
and Upload-Complete: ?1
. Wondering if the phrasing should be "unless the total length is unknown".
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.
or "unless the client has not supplied one (either by supplying its own upload-length or providing an Upload-Complete:?1 with a Content-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.
Yeah, that works
- MUST include the offset in the `Upload-Offset` header field ({{upload-offset}}), | ||
- MUST include the completeless state in the `Upload-Complete` header field ({{upload-complete}}), | ||
- MUST include the length in the `Upload-Length` header field if known ({{upload-length}}), | ||
- MUST include the length in the `Upload-Length` header field unless the client has not supplied one, either by providing its own `Upload-Length` ({{upload-length}}) or providing an Upload-Complete:?1 with a Content-Length ({{upload-complete}}), |
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.
The text could also just reference Section 4.1.3, which explains how the length of an upload can be discovered:
There are two different ways for the client to indicate and the upload resource to discover the length from requests for creating the upload resource (Section 4.2) or appending to it (Section 4.4):
- If the request includes the Upload-Complete field value set to true and a valid Content-Length header field, the request content is the remaining representation data. The length is then the sum of the current offset (Section 4.1.1) and the Content-Length header field value.
- The request can include the Upload-Length request and response header field. Upload-Length is an Item Structured Header Field ([STRUCTURED-FIELDS]). Its value is a non-negative Integer (Section 3.3.1 of [STRUCTURED-FIELDS]) and indicates the number of bytes of the entire representation data. Other values MUST cause the entire header field to be ignored.
(from https://httpwg.org/http-extensions/draft-ietf-httpbis-resumable-upload.html#section-4.1.3-2)
Maybe something along these lines:
- MUST include the length in the `Upload-Length` header field unless the client has not supplied one, either by providing its own `Upload-Length` ({{upload-length}}) or providing an Upload-Complete:?1 with a Content-Length ({{upload-complete}}), | |
- MUST include the length in the `Upload-Length` header field unless the client has not supplied one, by providing the corresponding headers as described in Section 4.1.3, |
That might be a bit more watertight.
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.
I'm happy to avoid restating requirements in multiple places in the document but I'd probably want to land #3200 first
I plan to rebase this and act on @Acconut's suggestion later today |
738ebde
to
31229a0
Compare
We have the requirement "if the client knows the representation data's length,
it SHOULD include the
Upload-Length
". Which means the server can be a positionto either know, or not know the value.
This change makes a minor tweak to the text to highlight that when the server
was given a length it really MUST respond with it but when it didn't get given
one it can't.
Fixes #3187