Description
Overall this is fairly straightforward - replicate the set of fixes, additional structs (ContentRange) and some of the error-reporting states.
There is, however, one important deviation when running inside a browser: 'Content-Range' is not a CORS-safelisted property 😬 : https://developer.mozilla.org/en-US/docs/Glossary/CORS-safelisted_response_header .
The upstream behaviour treats this as an error (rightly, given the HTTP spec mandates support for the Range
header -> support for the Content-Range
header, and CORS is inapplicable outside the browser) - in the browser case, this is probably a no-go, given the paucity of sites that include it in Access-Control-Expose-Headers
.
Since the meta.size
field is not an Option type, it must be set to something - the only problem with that is the natural fallback value (what object store used to do, namely use the Content-Length field) is likely to be wildly inaccurate.