Skip to content

Commit 0a6b061

Browse files
committed
clarify Content-Type / Content-Encoding / Content-Language handling
closes #158
1 parent 5646c29 commit 0a6b061

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

protocol.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Kleidl](https://twitter.com/Acconut_)<br>
4545
[J. Ryan Stinnett](https://convolv.es),
4646
[Ifedapo Olarewaju](https://github.com/ifedapoolarewaju)
4747
[Robert Nagy](https://github.com/ronag)
48+
[Nils Goroll](https://github.com/nigoroll)
4849

4950
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
5051
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
@@ -299,7 +300,7 @@ Host: tus.example.org
299300
Content-Length: 0
300301
Upload-Length: 100
301302
Tus-Resumable: 1.0.0
302-
Upload-Metadata: filename d29ybGRfZG9taW5hdGlvbl9wbGFuLnBkZg==,is_confidential
303+
Upload-Metadata: filename d29ybGRfZG9taW5hdGlvbl9wbGFuLnBkZg==,filetype YXBwbGljYXRpb24vcGRm,is_confidential
303304
```
304305

305306
**Response:**
@@ -330,6 +331,34 @@ ASCII encoded and the value MUST be Base64 encoded. All keys MUST be unique.
330331
The value MAY be empty. In these cases, the space, which would normally separate
331332
the key and the value, MAY be left out.
332333

334+
Clients and servers SHOULD implement the metadata key ``filetype``
335+
with the value containing the actual ``Content-Type`` of the Upload
336+
(because the ``Content-Type`` header is formally required to be set to
337+
``application/offset+octet-stream`` for [Creation with
338+
Upload](#creation-with-upload)).
339+
340+
Clients and servers MAY support additional well known metadata keys:
341+
342+
* ``filename`` for a common file name
343+
344+
The specific metadata keys documented herein are reserved for the
345+
respective use and MUST NOT be used for other purposes.
346+
347+
##### [Content-Encoding](https://httpwg.org/specs/rfc7231.html#header.content-encoding)
348+
349+
Clients MUST set the ``Content-Encoding`` header correctly IFF a
350+
content encoding is used.
351+
352+
As per RFC7231, Servers MUST respond with status 415 if they can not
353+
accept the ``Content-Encoding`` chosen by the client.
354+
355+
Servers MUST either store the ``Content-Encoding`` and deliver it with
356+
subsequent requests, or properly decode the content before storing it.
357+
358+
[Content-Language](https://httpwg.org/specs/rfc7231.html#header.content-language)
359+
360+
Clients and Servers SHOULD support the ``Content-Language`` header.
361+
333362
#### Requests
334363

335364
##### POST

0 commit comments

Comments
 (0)