-
Notifications
You must be signed in to change notification settings - Fork 102
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
Add Tus-Min/Max-Chunk-Size headers #93
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -182,6 +182,29 @@ The `Tus-Max-Size` response header MUST be a non-negative integer indicating the | |
allowed size of an entire upload in bytes. The Server SHOULD set this header if | ||
there is a known hard limit. | ||
|
||
#### Tus-Min-Chunk-Size | ||
|
||
The `Tus-Min-Chunk-Size` response header MUST be a non-negative integer indicating the | ||
recommended minimum size of a single chunk uploaded in a single `PATCH` request in bytes. | ||
The Server MAY set this recommendation if the underlying storage engine has a lower limit | ||
on how much data can be stored in a single take. The Client SHOULD use this number to | ||
determine in conjunction with other factors, such as the available bandwidth and the | ||
`Tus-Max-Chunk-Size` header, how much data SHOULD be transfered in one request. Furthermore, | ||
this header's value MAY represent a hard limit but also MAY be a recommendation. The Server | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hard limit, but also MAY |
||
SHOULD only set this header if it has this recommendation. | ||
|
||
#### Tus-Max-Chunk-Size | ||
|
||
The `Tus-Max-Chunk-Size` response header MUST be a non-negative integer indicating the | ||
recommended maximum size of a single chunk uploaded in a single `PATCH` request in bytes. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See first note. ... recommended minimum size in bytes ... |
||
The Server MAY set this recommendation if the underlying storage engine has an upper limit | ||
on how much data can be stored in a single take or if the used architecture does not allow | ||
streaming the body of the `PATCH` request. The Client SHOULD use this number to determine | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. or if the used architecture does not allow the body of the 'PATCH' request to be streamed. |
||
in conjunction with other factors, such as the available bandwidth and the | ||
`Tus-Min-Chunk-Size` header, how much data SHOULD be transfered in one request. Furthermore, | ||
this header's value MAY represent a hard limit but also MAY be a recommendation. The Server | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hard limit, but also |
||
SHOULD only set this header if it has this recommendation. | ||
|
||
#### X-HTTP-Method-Override | ||
|
||
The `X-HTTP-Method-Override` request header MUST be a string which MUST be | ||
|
@@ -237,8 +260,8 @@ The Server SHOULD always attempt to store as much of the received data as possib | |
|
||
An `OPTIONS` request MAY be used to gather information about the Server's current | ||
configuration. A successful response indicated by the `204 No Content` status | ||
MUST contain the `Tus-Version` header. It MAY include the `Tus-Extension` and | ||
`Tus-Max-Size` headers. | ||
MUST contain the `Tus-Version` header. It MAY include the `Tus-Extension`, | ||
`Tus-Max-Size`, `Tus-Min-Chunk-Size` and `Tus-Max-Chunk-Size` headers. | ||
|
||
The Client SHOULD NOT include the `Tus-Resumable` header in the request and the | ||
Server MUST ignore the header. | ||
|
@@ -248,8 +271,9 @@ Server MUST ignore the header. | |
This example clarifies the response for an `OPTIONS` request. The version used | ||
in both, request and response, is `1.0.0` while the Server is also capable of | ||
handling `0.2.2` and `0.2.1`. Uploads with a total size of up to 1GB are | ||
allowed and the extensions for [Creation](#creation) and | ||
[Expiration](#expiration) are enabled. | ||
allowed and the Server recommends that a single chunk should be smaller than | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should is in lower case here. Intended? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's intentional, because it's just a description of an example, not part of the specification. |
||
500MB. Furthermore, the [Creation](#creation) and [Expiration](#expiration) | ||
extensions are enabled. | ||
|
||
**Request:** | ||
|
||
|
@@ -266,6 +290,7 @@ HTTP/1.1 204 No Content | |
Tus-Resumable: 1.0.0 | ||
Tus-Version: 1.0.0,0.2.2,0.2.1 | ||
Tus-Max-Size: 1073741824 | ||
Tus-Max-Chunk-Size: 524288000 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume the Min is left out on purpose here to indicate these are options, correct? |
||
Tus-Extension: creation,expiration | ||
``` | ||
|
||
|
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 would place "in bytes" more to the front: indicating the recommended minimum size in bytes of a single chunk... Remove 'in bytes' at the end.