mechanize 0.8.3 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of mechanize might be problematic. Click here for more details.

data/History.txt CHANGED
@@ -1,5 +1,11 @@
1
1
  = Mechanize CHANGELOG
2
2
 
3
+ === 0.8.4
4
+
5
+ * Bug Fixes:
6
+ * Setting the port number on the host header.
7
+ * Fixing Authorization headers for picky servers
8
+
3
9
  === 0.8.3
4
10
 
5
11
  * Bug Fixes:
data/lib/www/mechanize.rb CHANGED
@@ -46,7 +46,7 @@ module WWW
46
46
  class Mechanize
47
47
  ##
48
48
  # The version of Mechanize you are using.
49
- VERSION = '0.8.3'
49
+ VERSION = '0.8.4'
50
50
 
51
51
  ##
52
52
  # User Agent aliases
@@ -24,11 +24,11 @@ module WWW
24
24
  request.basic_auth(@user, @password)
25
25
  when :iis_digest
26
26
  digest_response = self.gen_auth_header(uri,request, @digest, true)
27
- request.add_field('Authorization', digest_response)
27
+ request['Authorization'] = digest_response
28
28
  when :digest
29
29
  if @digest
30
30
  digest_response = self.gen_auth_header(uri,request, @digest)
31
- request.add_field('Authorization', digest_response)
31
+ request['Authorization'] = digest_response
32
32
  end
33
33
  end
34
34
  end
@@ -57,16 +57,17 @@ module WWW
57
57
 
58
58
  header = ''
59
59
  header << "Digest username=\"#{@user}\", "
60
- header << "realm=\"#{params['realm']}\", "
61
60
  if is_IIS then
62
61
  header << "qop=\"#{params['qop']}\", "
63
62
  else
64
63
  header << "qop=#{params['qop']}, "
65
64
  end
66
65
  header << "uri=\"#{uri.path}\", "
67
- header << "algorithm=\"#{params['algorithm']}\", "
68
- header << "opaque=\"#{params['opaque']}\", " if params['opaque']
69
- header << "nonce=\"#{params['nonce']}\", "
66
+ header << %w{ algorithm opaque nonce realm }.map { |field|
67
+ next unless params[field]
68
+ "#{field}=\"#{params[field]}\""
69
+ }.compact.join(', ')
70
+
70
71
  header << "nc=#{'%08x' % @@nonce_count}, "
71
72
  header << "cnonce=\"#{CNONCE}\", "
72
73
  header << "response=\"#{Digest::MD5.hexdigest(request_digest)}\""
@@ -23,7 +23,8 @@ module WWW
23
23
  end
24
24
  request['Accept-Encoding'] = 'gzip,identity'
25
25
  request['Accept-Language'] = 'en-us,en;q=0.5'
26
- request['Host'] = uri.host
26
+ host = "#{uri.host}#{uri.port.to_i == 80 ? '' : ':' + uri.port.to_s}"
27
+ request['Host'] = host
27
28
  request['Accept-Charset'] = 'ISO-8859-1,utf-8;q=0.7,*;q=0.7'
28
29
 
29
30
  unless @cookie_jar.empty?(uri)
data/mechanize.gemspec CHANGED
@@ -1,10 +1,10 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{mechanize}
3
- s.version = "0.8.2.20080925083219"
3
+ s.version = "0.8.3.20081002222419"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["Aaron Patterson"]
7
- s.date = %q{2008-09-25}
7
+ s.date = %q{2008-10-02}
8
8
  s.description = %q{The Mechanize library is used for automating interaction with websites. Mechanize automatically stores and sends cookies, follows redirects, can follow links, and submit forms. Form fields can be populated and submitted. Mechanize also keeps track of the sites that you have visited as a history.}
9
9
  s.email = %q{aaronp@rubyforge.org}
10
10
  s.extra_rdoc_files = ["EXAMPLES.txt", "FAQ.txt", "GUIDE.txt", "History.txt", "LICENSE.txt", "Manifest.txt", "NOTES.txt", "README.txt"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mechanize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Patterson
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-09-26 00:00:00 -07:00
12
+ date: 2008-10-02 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency