tus / tus-resumable-upload-protocol

Open Protocol for Resumable File Uploads
https://tus.io
MIT License
1.5k stars 102 forks source link

Example for OPTIONS request #91

Closed nerro closed 8 years ago

nerro commented 8 years ago

I am implementing currently TUS server in Java and have one question about OPTIONS request example.

In the documentation stands "The Client SHOULD NOT include the Tus-Resumable header in the request and the Server MUST discard it.", but in example below http request includes Tus-Resumable header and server answers with 204 status.

Request:

OPTIONS /files HTTP/1.1
Host: tus.example.org
Tus-Resumable: 1.0.0

Response:

HTTP/1.1 204 No Content
Tus-Resumable: 1.0.0
Tus-Version: 1.0.0,0.2.2,0.2.1
Tus-Max-Size: 1073741824
Tus-Extension: creation,expiration

So there is no difference whether Tus-Resumable header included or not. Perhaps I misunderstand something.

Acconut commented 8 years ago

I am implementing currently TUS server in Java

That sounds very cool :+1:

but in example below http request includes Tus-Resumable header

The specification does not prohibit adding the Tus-Resumable header to the request but does not recommend it. I do agree that this is an inconsistency in the document which needs to be addressed.

server answers with 204 status

This parts is completely correct. Since the server must discard this header, it has to ignore it completely. As you said, it does not make a difference whether the header is sent or not.

nerro commented 8 years ago

Thanks for rapid answer.

I thought, that "server discards" mean no response (https://tools.ietf.org/html/rfc863). Would it be better so "The Client SHOULD NOT include the Tus-Resumable header in the request and the Server MUST ignore it."

If you agree with proposal, I'll sent PR today.

Acconut commented 8 years ago

I agree with you that the phrase "discard" is too easy to misinterpret and we did not intended a connection to the Discard Protocol. Furthermore, I would be very pleased if you would send a pull request to improve the wording. What about making it even more descriptive by saying "Server MUST ignore the header."?

Acconut commented 8 years ago

Thank you for reporting and sending a better version, the PR is merged.