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

Respond 412 Precondition Failed if required headers are missing #80

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
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
10 changes: 8 additions & 2 deletions protocol.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# tus resumable upload protocol

**Version:** 1.0.0 ([SemVer](http://semver.org))<br>
**Version:** 1.1.0 ([SemVer](http://semver.org))<br>
**Date:** 2016-03-25<br>
**Authors:** [Felix Geisendörfer](https://twitter.com/felixge), [Kevin van
Zonneveld](https://twitter.com/kvz), [Tim Koschützki](https://twitter.com/tim_kos),
[Naren Venkataraman](https://github.com/vayam), [Marius
Kleidl](https://twitter.com/Acconut_)<br>
Kleidl](https://twitter.com/Acconut_), [Ben Stahl](https://github.com/bhstahl)<br>
**Collaborators**:
[Bruno de Carvalho](https://github.com/biasedbit),
[James Butler](https://github.com/sandfox),
Expand Down Expand Up @@ -210,6 +210,9 @@ bytes contained in the message at the given offset specified by the
`Upload-Offset` header. All `PATCH` requests MUST use
`Content-Type: application/offset+octet-stream`.

If the `Upload-Offset` or `Content-Type` headers are invalid or missing from the
request, the Server MUST return `412 Precondition Failed`.

The `Upload-Offset` header's value MUST be equal to the current offset of the
resource. In order to achieve parallel upload the
[Concatenation](#concatenation) extension MAY be used. If the offsets do not
Expand Down Expand Up @@ -338,6 +341,9 @@ Once set the length MUST NOT be changed. As long as the length of the upload is
not known, the Server MUST set `Upload-Defer-Length: 1` in all responses to
`HEAD` requests.

If the `Upload-Length` or `Upload-Defer-Length` headers are missing from the
request, the Server MUST return `412 Precondition Failed`.

If the Server supports deferring length, it MUST add `creation-defer-length` to
the `Tus-Extension` header.

Expand Down