-
Notifications
You must be signed in to change notification settings - Fork 151
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
Resumable Upload: Require client to adhere to limits in Upload-Limit
#3011
base: main
Are you sure you want to change the base?
Conversation
I'm hesitant about making this a MUST. Currently, our client does not parse The server can always enforce the limits by sending a |
I tend to agree with Guoye. I'd treat this as an advisory header, in the vein of Retry-After https://www.rfc-editor.org/rfc/rfc9110.html#section-10.2.3. In fact, removing the SHOULD might be closer to reality. Instead, we can explain why clients benefit from consuming the hint and taking some action. Then we can leave it up to them to make their own call. |
I understand that implementing the client behavior can be challenging, especially A client that ignores Upload-Limit can then run into issues uploading files that are larger than the server's maximum request size. Proxies usually reject requests that are too large with a 413, preventing the client from resuming, causing the upload to fail. As Guoye mentioned, the upload would work if the proxy consumes request content until reaching the size limit and then responding with a 5xx. The client will resume and the upload can continue, but I'm unsure if such a proxy behavior is feasible in reality. If a client respects the limits announced by the server, it can directly adjust to the server's restrictions and increase interoperability. |
I agree with these points. However, isn't that pretty much the situation we're already in today? I know that I operate proxy servers that have variable upload limits, and variable behaviour when it comes to buffering of upload before responding vs. Responding immediately and allowing uploads to continue unbuffered (aka streamed). The language in the Upload Limits section is currently that a server I know it feels like it might help to be strict but HTTP is generally quite loose. The market will decide what it wants to do. And if people are already saying "it's easier for me to deal with rejection staus codes like I do with all HTTP upload services than use Upload-Limit" the a MUST probably won't change their mind. |
Yes, leaving adherence to upload limits optional won't make interoperability less likely than it currently is. With this new draft we would have the opportunity to improve the chance of interoperability by learning from shortcomings in current deployments. That being said, this PR might not have the impact that I imagine. There will likely be two kinds of clients in production environments:
Considering that, I am also fine with leaving the SHOULD as is.
Fair point. We could consider making the limits more strict on the server-side. But then again, I consider the limits as hints from the server to client about what it will likely be able to handle, not as an enforceable contract. |
Currently, the client is not required to adhere to limits announced in the
Upload-Limit
header field in responses. As discussed in #3006 (comment), it doesn't make a lot of sense to give the client the option to willingly ignore limits that the server announces. Hence, this PR changes the normative language to require the client to adhere to any limits that the client received and recognizes.