Skip to content

Commit

Permalink
Merge pull request #13 from benjamin-ltr/master
Browse files Browse the repository at this point in the history
Fix ruby 3 bug for the download method
  • Loading branch information
maztch authored May 15, 2024
2 parents 6e5d24a + 1b1e6cb commit a22eaa1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ilovepdf/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def download_file
content_disposition = response.headers[:content_disposition]

if match_data = /filename\*\=utf-8\'\'([\W\w]+)/.match(content_disposition)
filename = URI.unescape(match_data[1].gsub('"', ''))
filename = URI.decode_www_form_component(match_data[1].gsub('"', ''))
else
match_data = / .*filename=\"([\W\w]+)\"/.match(content_disposition)
filename = match_data[1].gsub('"', '')
Expand Down

0 comments on commit a22eaa1

Please sign in to comment.