Skip to content

try out a hackaround for fixing getting the root attachment #131

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

Merged
merged 3 commits into from
Dec 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/webpage_cache_service/cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def get uri:

# Without manually managing the temp file, there isn't an easy way to
# breakup the following logic but I did my best and fuck you too rubocop
attachments = binary_temp_file do |temp_file|
binary_temp_file do |temp_file|
write_body response: response, to: temp_file

content_type = get_content_type(response: response, io: temp_file)
Expand All @@ -110,7 +110,7 @@ def get uri:
)
end

attachment = attachments.first
attachment = offline_cache.assets.order(:id).first

[ response, attachment ]
end
Expand Down