Skip to content

Commit

Permalink
Correctly handle redirects #153
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew committed Jan 11, 2023
1 parent d919dff commit 2ecd209
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def download_file(dir)

request = Typhoeus::Request.new(url, followlocation: true)
request.on_headers do |response|
return nil if response.code != 200
return nil unless [200,301,302].include? response.code
end
request.on_body { |chunk| downloaded_file.write(chunk) }
request.on_complete { downloaded_file.close }
Expand Down

0 comments on commit 2ecd209

Please sign in to comment.