http-extensions icon indicating copy to clipboard operation
http-extensions copied to clipboard

resumable: clarify client behavior on 413 response

Open mertalev opened this issue 2 months ago • 3 comments

This PR aims to address https://github.com/httpwg/http-extensions/issues/3193#issuecomment-3394903322

  • Makes min-append-size and max-append-size apply to upload creation requests as well
  • Recommends retrying with body in this range after receiving a 413
  • If limits are unknown, recommends discovering them with an OPTIONS request after a 413

These changes should make clients more resilient to server limits without giving up right away.

This is my first PR here, so sorry in advance if I made a mistake!

mertalev avatar Oct 23 '25 23:10 mertalev

Something to consider is whether the server can make the resource and respond with 413 at some point later, or if it needs to respond upfront without doing anything. In the former case, the 413 response would need to include the Location header and maybe the Upload-Offset. A similar question is for upload append, as to whether the server can accept some of the body before responding or if it must reject immediately.

It would probably be simpler for the client to know these requests are no-ops, but there has been discussion on having the server accept up to its limits and ignore the rest, which implies that it can respond after processing part of the request.

mertalev avatar Oct 24 '25 22:10 mertalev

Would prefer the server sending 104 with Location prior to 413. The only thing the client needs to do in that case is to allow 413 retry.

Based on the current spec, the server could send a 5xx after processing the request body to the limit, which would prompt the client to retry and resume. It's a hacky workaround though.

guoye-zhang avatar Oct 25 '25 08:10 guoye-zhang

The change looks OK to me. @Acconut what do you think?

guoye-zhang avatar Oct 25 '25 08:10 guoye-zhang