httpwg / http-extensions

HTTP Extensions in progress
https://httpwg.org/http-extensions/
447 stars 146 forks source link

Resumable Upload: Discover upload limits through OPTIONS request #2911

Closed Acconut closed 1 month ago

Acconut commented 1 month ago

This change allows client to discover support for resumable uploads and potential limits via an OPTIONS request.

Closes https://github.com/httpwg/http-extensions/issues/2833.

A brief comment on this sentence:

The limits announced in an OPTIONS response SHOULD NOT be less restrictive than the limits applied to an upload once the upload resource has been created.

Once the server has created an upload resource it might have more information available (user details, file metadata etc) and apply different limits than it would have known upfront for an OPTIONS request where this information was not available. We allow this difference but recommend that the upfront announced limits are not looser than the limits after the upload resource has been created. The client can then assume that it can create an upload resource if it obeys to the upfront announced limits even if looser limits will then apply later. Does this make sense? Or is this addition rather unnecessary?

guoye-zhang commented 1 month ago

Is OPTIONS a required feature on the server side? What about OPTIONS * requests?

Acconut commented 1 month ago

Is OPTIONS a required feature on the server side?

Yes, I think a server should be required to support this. If it only wants to provide resumable uploads for specific users, it does not have to announce this for unauthorized users.

What about OPTIONS * requests?

If a server supports resumable uploads for all target URIs, then it should respond with Upload-Limit to an OPTIONS * request. But I am unsure how often this actually happens.