-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clarify Content-Type / Content-Encoding / Content-Language handling #160
Open
nigoroll
wants to merge
2
commits into
tus:main
Choose a base branch
from
nigoroll:metadata
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,7 @@ Kleidl](https://twitter.com/Acconut_)<br> | |
[J. Ryan Stinnett](https://convolv.es), | ||
[Ifedapo Olarewaju](https://github.com/ifedapoolarewaju) | ||
[Robert Nagy](https://github.com/ronag) | ||
[Nils Goroll](https://github.com/nigoroll) | ||
|
||
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", | ||
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be | ||
|
@@ -299,7 +300,7 @@ Host: tus.example.org | |
Content-Length: 0 | ||
Upload-Length: 100 | ||
Tus-Resumable: 1.0.0 | ||
Upload-Metadata: filename d29ybGRfZG9taW5hdGlvbl9wbGFuLnBkZg==,is_confidential | ||
Upload-Metadata: filename d29ybGRfZG9taW5hdGlvbl9wbGFuLnBkZg==,filetype YXBwbGljYXRpb24vcGRm,is_confidential | ||
``` | ||
|
||
**Response:** | ||
|
@@ -334,6 +335,27 @@ Since metadata can contain arbitrary binary values, Servers SHOULD | |
carefully validate metadata values or sanitize them before using them | ||
as header values to avoid header smuggling. | ||
|
||
Servers and Clients SHOULD use the metadata key `filename` to communicate the file name | ||
of the uploaded data, if such a name is available. The metadata key `filetype` SHOULD | ||
be used communicate the [media type](https://www.iana.org/assignments/media-types/media-types.xhtml) | ||
of the uploaded data. These metadata keys SHOULD not be used for any other purposes as | ||
described here. | ||
|
||
##### [Content-Encoding](https://httpwg.org/specs/rfc7231.html#header.content-encoding) | ||
|
||
Clients MUST set the ``Content-Encoding`` header correctly IFF a | ||
content encoding is used. | ||
|
||
As per RFC7231, Servers MUST respond with status 415 if they can not | ||
accept the ``Content-Encoding`` chosen by the client. | ||
|
||
Servers MUST either store the ``Content-Encoding`` and deliver it with | ||
subsequent requests, or properly decode the content before storing it. | ||
|
||
##### [Content-Language](https://httpwg.org/specs/rfc7231.html#header.content-language) | ||
|
||
Clients and Servers SHOULD support the ``Content-Language`` header. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you elaborate more what "supporting the Content-Language header" means? To be concrete: Can you say what behavior a typical tus server (e.g. tusd) must have to support this header? |
||
|
||
#### Requests | ||
|
||
##### POST | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that the Content-Encoding header must be present in the response for every PATCH, DELETE and HEAD request?