Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fedora storage adapter expects io to have #length #936

Open
dlpierce opened this issue Sep 26, 2023 · 0 comments
Open

Fedora storage adapter expects io to have #length #936

dlpierce opened this issue Sep 26, 2023 · 0 comments

Comments

@dlpierce
Copy link
Contributor

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 added a commit to samvera/hyrax that referenced this issue Sep 26, 2023
dlpierce added a commit to samvera/hyrax that referenced this issue Sep 26, 2023
* Use StreamFile#disk_path instead of io directly

The Fedora storage adapter sets io to be an IOProxy which basename cannot make use of.

* Do not use shovel operator << when setting ids

The Fedora metadata adapter provides frozen empty arrays as default values. It is unknown why the Postgres adapter defaults are unfrozen.

* Patch File to workaround samvera/valkyrie#936

* Add config for valkyrie fedora faraday connection

* Rubocop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant