-
Notifications
You must be signed in to change notification settings - Fork 137
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
Restrict use of Content-Encoding for upload append #2674
Comments
I don't follow. The content-encoding is tied to the representation. So an upload using gzip that gets interrupted halfway through, should be able to be patched with the last half of the gzip representation. Maybe the concern is
? Each of those seems like things we should accomodate and explain but not prohibit. HTTP representations are our friend here. |
Yes, those two are the concerns behind this issue. I am not sure if there are use cases where the client would like to change the encoding when resuming the upload.
Correct, that behavior should be the norm. Resuming without gzip (or resuming with another compression) would be problematic because the parts cannot be concatenated properly. I hope that helps to clear up this topic. I will dig more into the HTTP representations to see how we can accommodate this better in the draft. |
Even though real-world servers do perform compression on-the-fly, as a matter of HTTP, Content-Encoding is a property of the representation. If something is uploaded with If a client wanted to gzip the bytes being appended using compression local only to that message, that would be a Transfer-Encoding. However, T-Es have been removed from HTTP/2 and later, so they're not likely to be useful here. More generally, I think what we want to say is that:
|
I agree with all of these points, thanks for writing this up. I will try to open a PR, so this is clarified in the PR.
If an upload resource is created with Did you have another intention behind using
|
The initial POST request to create the upload resource might contain Content-Encoding, e.g.
Content-Encoding: gzip
. If the upload gets interrupted, it might be resumed using a HEAD and PATCH request. This subsequent PATCH request should then not contain a conflicting Content-Encoding header field, because the server would not be able to know what Content-Encoding has to be used once the upload is complete.Maybe we should disallow including Content-Encoding at all when appending to an upload. Because the upload might have been interrupted at an arbitrary position, neither the partial content received before the interruption nor the partial content transferred after the interruption are guaranteed to be valid gzip data, for example.
A similar argument could also be made to restrict Content-Language in these PATCH requests.
The text was updated successfully, but these errors were encountered: