valkyrie icon indicating copy to clipboard operation
valkyrie copied to clipboard

Fedora storage adapter expects io to have #length

Open dlpierce opened this issue 2 years ago • 0 comments

Attempting to upload a ::File using the fedora storage adapter fails with Content-Length not given and Transfer-Encoding is not 'chunked' coming from Net::HTTP. The Content-Length header does not get set because ::File does not have a #length method (only #size) and the storage adapter #upload_file method only checks for #size.

The specs use a Tempfile which does have a length alias for size.

Expected behavior: A ::File passed to Valkyrie::Storage::Fedora#upload_file uploads to fedora successfully.

Actual behavior: ArgumentError: Content-Length not given and Transfer-Encoding is not 'chunked'

dlpierce avatar Sep 26 '23 17:09 dlpierce