Skip to content
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 Creation With Upload extension #88

Merged
merged 5 commits into from
Oct 6, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,20 @@ If the length of the upload exceeds the maximum, which MAY be specified using
the `Tus-Max-Size` header, the Server MUST respond with the
`413 Request Entity Too Large` status.

The Client MAY include the entire or a chunk of the data, which is meant to be
uploaded, in the body of the `POST` request. In this case, similar rules as for
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about this wording?
The Client MAY include the entirety or a chunk of the data to be uploaded in the body of the POST request.

the `PATCH` request and response apply. The Client MUST include the
`Content-Type: application/offset+octet-stream` header. The Server SHOULD accept
as many bytes as possible and MUST include the `Upload-Offset` in the response
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upload-Offset

Upload-Offset header

and MUST set its value to the offset of the upload after applying the accepted
bytes. If the Server supports the functionality described in this paragraph, it
MUST advertise this by including the `creation-with-chunk` value to the
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think creation-with-data would be a more general name

`Tus-Extension` header. The Client SHOULD verify that the Server is capable of
handling this cases before sending the `POST` request. In addition, the Client
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we said:
The Client SHOULD verify that the Server is capable of handling file data in the Create body before sending the POST request.

If not, I believe it should be either "this case" or "these cases"

SHOULD include the `Expect: 100-continue` header in the request to receive
early feedback from the Server whether it will accept the creation request
before attempting to transfer the first chunk.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we simplify this to say:
..."to receive early feedback from the Server before attempting to transfer the first chunk."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the current sentence should be kept as it also explains which type of feedback is provided by the server.

The Server MUST acknowledge a successful upload creation with the `201 Created`
status. The Server MUST set the `Location` header to the URL of the created
resource. This URL MAY be absolute or relative.
Expand Down