deathbycaptcha 4.1.3 → 4.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -147,7 +147,7 @@ module DeathByCaptcha
147
147
  # => a url if it's a String and starts with 'http://'
148
148
  # => a filesystem path otherwise
149
149
  #
150
- def load_file(captcha, is_raw_content = false)
150
+ def load_file(captcha, is_raw_content = false, headers = {})
151
151
 
152
152
  file = nil
153
153
 
@@ -164,7 +164,7 @@ module DeathByCaptcha
164
164
  elsif captcha.kind_of? String and captcha.match(/^https?:\/\//i)
165
165
  # Create a temporary file, download the file, write it to tempfile and return it
166
166
  tmp_file_path = File.join(Dir.tmpdir, "captcha_#{Time.now.to_i}_#{rand}")
167
- File.open(tmp_file_path, 'wb') { |f| f.write RestClient.get(captcha) }
167
+ File.open(tmp_file_path, 'wb') { |f| f.write RestClient.get(captcha, headers) }
168
168
  file = File.open(tmp_file_path, 'r')
169
169
 
170
170
  else
@@ -39,7 +39,7 @@ module DeathByCaptcha
39
39
  data = userpwd
40
40
  data[:swid] = config.software_vendor_id
41
41
  data[:is_case_sensitive] = (options[:is_case_sensitive] ? 1 : 0)
42
- data[:captchafile] = load_file(captcha, options[:is_raw_content])
42
+ data[:captchafile] = load_file(captcha, options[:is_raw_content], options[:headers])
43
43
  response = call('captcha', data)
44
44
 
45
45
  return response if response['captcha']
@@ -1,4 +1,4 @@
1
1
  module DeathByCaptcha
2
- VERSION = "4.1.3"
2
+ VERSION = "4.1.4"
3
3
  API_VERSION = "DBC/Ruby v4.1.2"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deathbycaptcha
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.3
4
+ version: 4.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-27 00:00:00.000000000 Z
12
+ date: 2013-02-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client