Skip to content

Commit f22a926

Browse files
author
Ben Stahl
committed
Respond 412 Precondition Failed if required headers are missing
Closes #79
1 parent c6f249e commit f22a926

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

protocol.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ bytes contained in the message at the given offset specified by the
210210
`Upload-Offset` header. All `PATCH` requests MUST use
211211
`Content-Type: application/offset+octet-stream`.
212212

213+
If the `Upload-Offset` or `Content-Type` headers are invalid or missing from the
214+
request, the Server MUST return `412 Precondition Failed`.
215+
213216
The `Upload-Offset` header's value MUST be equal to the current offset of the
214217
resource. In order to achieve parallel upload the
215218
[Concatenation](#concatenation) extension MAY be used. If the offsets do not
@@ -338,6 +341,9 @@ Once set the length MUST NOT be changed. As long as the length of the upload is
338341
not known, the Server MUST set `Upload-Defer-Length: 1` in all responses to
339342
`HEAD` requests.
340343

344+
If the `Upload-Length` or `Upload-Defer-Length` headers are missing from the
345+
request, the Server MUST return `412 Precondition Failed`.
346+
341347
If the Server supports deferring length, it MUST add `creation-defer-length` to
342348
the `Tus-Extension` header.
343349

0 commit comments

Comments
 (0)