Permalink
Browse files

Merge pull request #1 from inkredabull/master

Added support for captcha image URLs protected by HTTPS
  • Loading branch information...
2 parents 5b46501 + 98a3502 commit ff203d6f81c4075f5731288bc707cf5c88d55bbc @barbolo barbolo committed Sep 29, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/deathbycaptcha/client.rb
@@ -171,7 +171,7 @@ def load_file(captcha, is_raw_content=false)
# simply return the file
file = captcha
- elsif captcha.kind_of? String and captcha[0,7] == 'http://'
+ elsif captcha.kind_of? String and captcha.match(/^https?:\/\//)
# Create a temporary file, download the file, write it to tempfile and return it
tmp_file_path = File.join(Dir.tmpdir, "captcha_#{Time.now.to_i}_#{rand}")
File.open(tmp_file_path, 'w') {|f| f.write RestClient.get(captcha)}
@@ -194,4 +194,4 @@ def load_file(captcha, is_raw_content=false)
end
-end
+end

0 comments on commit ff203d6

Please sign in to comment.