Skip to content

Commit 32ab6ba

Browse files
committed
Add optional Content-Location response header
... to inform the Client about the permanent location of completed uploads. This is motivated by the following use cases: * TUS servers may not implement storage themselves, such that the `Location` returned for a creation (POST) request be only transitional. * TUS servers may decide to change the storage location once the upload is complete, for example to * implement content-based naming (where the file name is some hash over the content) * name content based on type * or select paths by size The `Content-Location` header is already defined by the HTTP RFCs, so, stricly speaking, its use should be implicitly allowed and well defined. Yet, for TUS, it makes sense to allow use of this response header for additional HTTP verbs (e.g. `PATCH`) and it might help implementation interoperability to point it out.
1 parent 5646c29 commit 32ab6ba

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

protocol.md

+11
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ Tus-Resumable: 1.0.0
141141
HTTP/1.1 204 No Content
142142
Tus-Resumable: 1.0.0
143143
Upload-Offset: 100
144+
Content-Location: https://tus.example.org/storage/d41d8cd98f00b204e9800998ecf8427e
144145
```
145146

146147
### Headers
@@ -191,6 +192,16 @@ interpreted as the request's method by the Server, if the header is presented.
191192
The actual method of the request MUST be ignored. The Client SHOULD use this
192193
header if its environment does not support the PATCH or DELETE methods.
193194

195+
#### Content-Location
196+
197+
The Server MAY send a `Content-Location` header with any response to a
198+
`POST`, `PATCH`, `HEAD` or `GET` request once the upload is complete
199+
(`Upload-Offset` == `Upload-Length`) to optionally indicate to the
200+
Client a new location of the upload.
201+
202+
See [RFC 7231 Section
203+
3.1.4.2](https://httpwg.org/specs/rfc7231.html#header.content-location).
204+
194205
### Requests
195206

196207
#### HEAD

0 commit comments

Comments
 (0)