You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the response was 204 No Content, then file.body will return nil, which StringIO.new can't handle.
Given that this url download was intended to get content, and it got no content, it would make sense to explicitly raise a CarrierWave::DownloadError in this case.
The text was updated successfully, but these errors were encountered:
BrianHawley
added a commit
to BrianHawley/carrierwave
that referenced
this issue
Sep 28, 2022
Have RemoteFile raise CarrierWave::DownloadError when the HTTP response
is of a type that has no content, according to the standards.
In those cases, response.body returns nil.
There are 8 response types that have no body, 4 of which we can get, so
just check whether the body was nil.
Fixescarrierwaveuploader#2632
In lib/carrierwave/downloader/remote_file.rb you have this code:
If the response was 204 No Content, then
file.body
will return nil, whichStringIO.new
can't handle.Given that this url download was intended to get content, and it got no content, it would make sense to explicitly raise a CarrierWave::DownloadError in this case.
The text was updated successfully, but these errors were encountered: