-
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
base: main
Are you sure you want to change the base?
Conversation
I am not sure if adding recommendations about Content-Encoding and Content-Language headers is a good idea. If I understand correctly, these headers are mostly relevant for GET requests, which tus does neither mention nor use. Of course, if your server supports GET requests nevertheless, the Content-Encoding and Content-Language headers may also be included in HEAD responses but that in itself is not relevant for tus. Is it understandable what I mean? The changes regarding metadata are good, but let's clarify the other point first. |
(force-pushed only to resolve the merge conflict, no content changed) re @Acconut regarding your interpretation that the HTTP metadata headers were specific to Regarding Please note that RFC7231 explicitly considers uploads in this paragraph:
|
Note really a fan of this part at all. There are multiple implementations out there already and if they use any of the keys defined for anything else than this update says then they would be in violation with the spec. In other parts I agree that this would be a good addition to the spec. |
@smatsson would you have a better suggestion to reserving the metadata keys? My original suggestion was to make a breaking change and use |
@nigoroll To be the devil's advocate: Why would we need to reserve metadata keys to begin with? The 1.0 version of protocol has been around since 2015 and haven't included any reserved keys. I think that the openness of not reserving metadata keys is a good thing as words have different meanings in different contexts. For example I would not translate "filetype" to |
@smatsson we cannot have agreement on semantics without agreement on how to represent that semantics. My impression from the discussion in #158 was that the |
@nigoroll I'm only concerned with the breaking changes and that the protocol will be ambiguous between implementations and when they were implemented (as the spec changed). As I said earlier I don't really object to the change per se, just the breaking change part. If you and @Acconut feel strongly that this should go in the spec it's fine by me. |
|
||
##### [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 comment
The 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?
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. |
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.
deliver it with subsequent requests
Does this mean that the Content-Encoding header must be present in the response for every PATCH, DELETE and HEAD request?
protocol.md
Outdated
* ``filename`` for a common file name | ||
|
||
The specific metadata keys documented herein are reserved for the | ||
respective use and MUST NOT be used for other purposes. |
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.
I agree with @smatsson that this sentence is too restrictive. It would be a breaking change and there are no plans to make a major release for tus. I don't think this would serve the ecosystem well.
That being said, I am happy to recommend (not force) the usage of the filename and filetype metadata keys for the purposes as laid out here.
@nigoroll Would it be OK if I add some commits to this PR to show what I mean with some of my comments? |
@Acconut sure |
Do we need to consider the Content-Encoding changing between requests? E.g. the file is created with |
I adjusted the phrasing of the filename and filetype metadata keys to match the rest of the document and to also ensure that this is not a breaking change. Let me know what you think @nigoroll There are also some questions from me above. Could you have a look at them when you have the time? |
see #158 for discussion