pinch icon indicating copy to clipboard operation
pinch copied to clipboard

Restore test suite, remove content length request

Open sj26 opened this issue 1 year ago • 0 comments

Hey there! I always loved the idea of this gem. I love how simple it is. But I've never had reason to use it -- until recently.

I dug in a little and noticed the test suite wasn't really running, so I did a little update to get that working and add net-http as an explicit dependency as required by modern ruby. And, sadly, Rubinius is long gone. I also had to remove the basic auth tests because that doesn't seem to be enforced at the test endpoint any more.

Then I noticed that the gem does an initial request to get the content-length - but this isn't required. You can ask for the last 4096 bytes of a remote resource by specifying Range: bytes=-4096 which Net::HTTP supports as #set_range(-4096) and which simplifies the implementation.

Not sure if you're interested in contributions, but I offer it at your leisure :pray:

sj26 avatar Nov 20 '24 00:11 sj26