Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f22a926

Browse files
author
Ben Stahl
committedMay 6, 2016
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

+6
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

4 commit comments

Comments
 (4)

zajnbovv commented on Nov 3, 2017

@zajnbovv

@bhstahl : I have a issue with 412 status.
I've download your example and ran 2 platform iOS and Android with the same server that config with tus flow. But only iOS can run, and Android have 412 issue.
I have read all of your posts and others related to 412 status, but non of them support my answer with Android problem.
Could you help me with this? Thanks

bhstahl commented on Nov 3, 2017

@bhstahl

Hey @zajnbovv, I'm sorry to hear you're having trouble. What server implementation are you using? Can you open a ticket on the repository there so we can help get to the bottom of the issue?

zajnbovv commented on Nov 7, 2017

@zajnbovv

@bhstahl : the problem has been solved but in the weirdo way.
I have changed the java_client using from gradle import to download your project as zip and copy all the class to the example. AND IT WORK.
Still can't find the reason, please update for other devs that have the same problem if you find the reason.

Acconut commented on Nov 8, 2017

@Acconut
Member

@zajnbovv I am happy to read that you were able to solve this issue. Unfortunately, I have never heard of something similar to your problem before, but please feel free to post any issues directly to the project of the tus-java-client: https://github.com/tus/tus-java-client/issues

Please sign in to comment.