Skip to content

Fedora storage adapter expects io to have #length #936

@dlpierce

Description

@dlpierce

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions