3 ms·
> There's no sane way to add support for this header and make older servers behave correctly, so now we have better facilities for this KISS. Endow the "400 Ba
by zozbot123 8y ago
> There's no sane way to add support for this header and make older servers behave correctly, so now we have better facilities for this
KISS. Endow the "400 Bad Request" server response with a special header that acts like a cookie or nonce, with the semantics "this server does support Content-Range uploads and won't corrupt your resource". If the client resends the PUT + Content-Range request with the correct cookie/nonce added to it, it has acknowledged this semantics in turn, and the upload can now go through. This adds a roundtrip, but it's still trivial compared to what's being proposed here, and keeps the semantics of PATCH open for more complicated cases.
- irishsultan 8y agoYou still need to update all those old servers to stop ignoring the Content-Range and abort in it's presence.
- aaaaaaaaaab 8y agoOr do a HEAD on the resource you want to resume uploading (this is recommended to find out how many bytes have actually went through) and if the response contains a "Accept-Range: true" header then the client can resume the upload.