renterd
renterd copied to clipboard
Add Content-Range support to the PUT api/worker/objects/:key Endpoint
Description
When doing an API call like this: PUT /api/worker/objects%2F1536-f.txt?bucket=default HTTP/1.1
and passing headers like this:
Content-Length: 2477
Content-Type: application/octet-stream
Content-Range: bytes 4096-6573/
the renterd API should honour and accept the Range. Currently, it ignores it and when sending a file in 2 ranges, the second range overwrites the first one.
This would make easier the coding for the siafs (grant). Also, it is a good idea to keep the API to honour the HTTP headers when dealing with files.
Version
v1.0.6
What operating system are you running (e.g. Ubuntu 22.04, macOS, Windows 11)?
Linux
Anything else?
RFC: https://datatracker.ietf.org/doc/html/rfc7233#section-4.2
Log:
> PUT /api/worker/objects/1536-f.txt?bucket=default HTTP/1.1
Host: 192.168.7.52:9880
Authorization: Basic OXXXXXXX==
Accept: */*
Content-Length: 2477
Content-Type: application/octet-stream
Content-Range: bytes 4096-6573/*