Skip to content

Commit

Permalink
Respond 412 Precondition Failed if required headers are missing
Browse files Browse the repository at this point in the history
Closes tus#79
  • Loading branch information
Ben Stahl committed May 6, 2016
1 parent c6f249e commit f22a926
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions protocol.md
Original file line number Diff line number Diff line change
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

1 comment on commit f22a926

@zajnbovv
Copy link

Choose a reason for hiding this comment

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

@bhstahl : How can I fix this problem on Android? How can I add header for my request?

Please sign in to comment.