Skip to content

Commit 2ecd209

Browse files
committed
Correctly handle redirects #153
1 parent d919dff commit 2ecd209

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/models/job.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def download_file(dir)
9191

9292
request = Typhoeus::Request.new(url, followlocation: true)
9393
request.on_headers do |response|
94-
return nil if response.code != 200
94+
return nil unless [200,301,302].include? response.code
9595
end
9696
request.on_body { |chunk| downloaded_file.write(chunk) }
9797
request.on_complete { downloaded_file.close }

0 commit comments

Comments
 (0)