Skip to content

Commit

Permalink
Forced PDF encoding to be ASCII_8BIT
Browse files Browse the repository at this point in the history
  • Loading branch information
asselstine committed Nov 15, 2016
1 parent d4c7ef4 commit 56aa9cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/dotloop/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ def all(profile_id:, loop_view_id:)

def get(profile_id:, loop_view_id:, document_id:, document_name:)
document_name = CGI.escape(document_name.delete('/'))
StringIO.new(
sio = StringIO.new
sio.set_encoding(Encoding::ASCII_8BIT)
sio.write(
@client.raw(
"/profile/#{profile_id.to_i}/loop/#{loop_view_id.to_i}/document/#{document_id}/#{document_name}.pdf"
)
)
sio.flush
sio.close
sio
end
end
end
3 changes: 2 additions & 1 deletion spec/helpers/fixtures.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ def disclosure_file_data
File.read(
filename_to_path(
'profile/1234/loop/76046/document/561622/AgencyDisclosureStatementSeller.pdf'
)
),
encoding: Encoding::ASCII_8BIT
)
end

Expand Down

0 comments on commit 56aa9cd

Please sign in to comment.