corntrace-fakeweb 1.2.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/.gitignore +9 -0
  2. data/CHANGELOG +197 -0
  3. data/LICENSE.txt +281 -0
  4. data/README.rdoc +222 -0
  5. data/Rakefile +70 -0
  6. data/fakeweb.gemspec +123 -0
  7. data/lib/fake_web.rb +179 -0
  8. data/lib/fake_web/VERSION +1 -0
  9. data/lib/fake_web/ext/net_http.rb +81 -0
  10. data/lib/fake_web/registry.rb +114 -0
  11. data/lib/fake_web/responder.rb +120 -0
  12. data/lib/fake_web/response.rb +10 -0
  13. data/lib/fake_web/stub_socket.rb +15 -0
  14. data/lib/fake_web/utility.rb +65 -0
  15. data/lib/fakeweb.rb +2 -0
  16. data/test/fixtures/google_response_from_curl +12 -0
  17. data/test/fixtures/google_response_with_transfer_encoding +17 -0
  18. data/test/fixtures/google_response_without_transfer_encoding +11 -0
  19. data/test/fixtures/test_example.txt +1 -0
  20. data/test/fixtures/test_txt_file +3 -0
  21. data/test/test_allow_net_connect.rb +85 -0
  22. data/test/test_deprecations.rb +54 -0
  23. data/test/test_fake_authentication.rb +92 -0
  24. data/test/test_fake_web.rb +553 -0
  25. data/test/test_fake_web_open_uri.rb +58 -0
  26. data/test/test_helper.rb +87 -0
  27. data/test/test_missing_open_uri.rb +25 -0
  28. data/test/test_missing_pathname.rb +37 -0
  29. data/test/test_other_net_http_libraries.rb +36 -0
  30. data/test/test_precedence.rb +79 -0
  31. data/test/test_query_string.rb +45 -0
  32. data/test/test_regexes.rb +157 -0
  33. data/test/test_response_headers.rb +73 -0
  34. data/test/test_trailing_slashes.rb +53 -0
  35. data/test/test_utility.rb +76 -0
  36. data/test/vendor/right_http_connection-1.2.4/History.txt +59 -0
  37. data/test/vendor/right_http_connection-1.2.4/Manifest.txt +7 -0
  38. data/test/vendor/right_http_connection-1.2.4/README.txt +54 -0
  39. data/test/vendor/right_http_connection-1.2.4/Rakefile +103 -0
  40. data/test/vendor/right_http_connection-1.2.4/lib/net_fix.rb +160 -0
  41. data/test/vendor/right_http_connection-1.2.4/lib/right_http_connection.rb +435 -0
  42. data/test/vendor/right_http_connection-1.2.4/setup.rb +1585 -0
  43. data/test/vendor/samuel-0.2.1/.document +5 -0
  44. data/test/vendor/samuel-0.2.1/.gitignore +5 -0
  45. data/test/vendor/samuel-0.2.1/LICENSE +20 -0
  46. data/test/vendor/samuel-0.2.1/README.rdoc +70 -0
  47. data/test/vendor/samuel-0.2.1/Rakefile +62 -0
  48. data/test/vendor/samuel-0.2.1/VERSION +1 -0
  49. data/test/vendor/samuel-0.2.1/lib/samuel.rb +52 -0
  50. data/test/vendor/samuel-0.2.1/lib/samuel/net_http.rb +10 -0
  51. data/test/vendor/samuel-0.2.1/lib/samuel/request.rb +96 -0
  52. data/test/vendor/samuel-0.2.1/samuel.gemspec +69 -0
  53. data/test/vendor/samuel-0.2.1/test/request_test.rb +193 -0
  54. data/test/vendor/samuel-0.2.1/test/samuel_test.rb +42 -0
  55. data/test/vendor/samuel-0.2.1/test/test_helper.rb +66 -0
  56. data/test/vendor/samuel-0.2.1/test/thread_test.rb +32 -0
  57. metadata +167 -0
@@ -0,0 +1 @@
1
+ 1.2.9
@@ -0,0 +1,81 @@
1
+ require 'net/http'
2
+ require 'net/https'
3
+ require 'stringio'
4
+
5
+ module Net #:nodoc: all
6
+
7
+ class BufferedIO
8
+ def initialize_with_fakeweb(io, debug_output = nil)
9
+ @read_timeout = 60
10
+ @rbuf = ''
11
+ @debug_output = debug_output
12
+
13
+ @io = case io
14
+ when Socket, OpenSSL::SSL::SSLSocket, IO
15
+ io
16
+ when String
17
+ if !io.include?("\0") && File.exists?(io) && !File.directory?(io)
18
+ File.open(io, "r")
19
+ else
20
+ StringIO.new(io)
21
+ end
22
+ end
23
+ raise "Unable to create local socket" unless @io
24
+ end
25
+ alias_method :initialize_without_fakeweb, :initialize
26
+ alias_method :initialize, :initialize_with_fakeweb
27
+ end
28
+
29
+ class HTTP
30
+ class << self
31
+ def socket_type_with_fakeweb
32
+ FakeWeb::StubSocket
33
+ end
34
+ alias_method :socket_type_without_fakeweb, :socket_type
35
+ alias_method :socket_type, :socket_type_with_fakeweb
36
+ end
37
+
38
+ def request_with_fakeweb(request, body = nil, &block)
39
+ protocol = use_ssl? ? "https" : "http"
40
+
41
+ path = request.path
42
+ path = URI.parse(request.path).request_uri if request.path =~ /^http/
43
+
44
+ if request["authorization"] =~ /^Basic /
45
+ userinfo = FakeWeb::Utility.decode_userinfo_from_header(request["authorization"])
46
+ userinfo = FakeWeb::Utility.encode_unsafe_chars_in_userinfo(userinfo) + "@"
47
+ else
48
+ userinfo = ""
49
+ end
50
+
51
+ uri = "#{protocol}://#{userinfo}#{self.address}:#{self.port}#{path}"
52
+ method = request.method.downcase.to_sym
53
+
54
+ if FakeWeb.registered_uri?(method, uri)
55
+ @socket = Net::HTTP.socket_type.new
56
+ FakeWeb.response_for(method, uri, &block)
57
+ elsif FakeWeb.allow_net_connect?
58
+ connect_without_fakeweb
59
+ request_without_fakeweb(request, body, &block)
60
+ else
61
+ uri = FakeWeb::Utility.strip_default_port_from_uri(uri)
62
+ raise FakeWeb::NetConnectNotAllowedError,
63
+ "Real HTTP connections are disabled. Unregistered request: #{request.method} #{uri}"
64
+ end
65
+ end
66
+ alias_method :request_without_fakeweb, :request
67
+ alias_method :request, :request_with_fakeweb
68
+
69
+
70
+ def connect_with_fakeweb
71
+ unless @@alredy_checked_for_net_http_replacement_libs ||= false
72
+ FakeWeb::Utility.puts_warning_for_net_http_replacement_libs_if_needed
73
+ @@alredy_checked_for_net_http_replacement_libs = true
74
+ end
75
+ nil
76
+ end
77
+ alias_method :connect_without_fakeweb, :connect
78
+ alias_method :connect, :connect_with_fakeweb
79
+ end
80
+
81
+ end
@@ -0,0 +1,114 @@
1
+ module FakeWeb
2
+ class Registry #:nodoc:
3
+ include Singleton
4
+
5
+ attr_accessor :uri_map
6
+
7
+ def initialize
8
+ clean_registry
9
+ end
10
+
11
+ def clean_registry
12
+ self.uri_map = Hash.new { |hash, key| hash[key] = {} }
13
+ end
14
+
15
+ def register_uri(method, uri, options)
16
+ uri_map[normalize_uri(uri)][method] = [*[options]].flatten.collect do |option|
17
+ FakeWeb::Responder.new(method, uri, option, option[:times])
18
+ end
19
+ end
20
+
21
+ def registered_uri?(method, uri)
22
+ !responders_for(method, uri).empty?
23
+ end
24
+
25
+ def response_for(method, uri, &block)
26
+ responders = responders_for(method, uri)
27
+ return nil if responders.empty?
28
+
29
+ next_responder = responders.last
30
+ responders.each do |responder|
31
+ if responder.times and responder.times > 0
32
+ responder.times -= 1
33
+ next_responder = responder
34
+ break
35
+ end
36
+ end
37
+
38
+ next_responder.response(uri, &block)
39
+ end
40
+
41
+
42
+ private
43
+
44
+ def responders_for(method, uri)
45
+ uri = normalize_uri(uri)
46
+
47
+ uri_map_matches(method, uri, URI) ||
48
+ uri_map_matches(:any, uri, URI) ||
49
+ uri_map_matches(method, uri, Regexp) ||
50
+ uri_map_matches(:any, uri, Regexp) ||
51
+ []
52
+ end
53
+
54
+ def uri_map_matches(method, uri, type_to_check = URI)
55
+ uris_to_check = variations_of_uri_as_strings(uri)
56
+
57
+ matches = uri_map.select { |registered_uri, method_hash|
58
+ registered_uri.is_a?(type_to_check) && method_hash.has_key?(method)
59
+ }.select { |registered_uri, method_hash|
60
+ if type_to_check == URI
61
+ uris_to_check.include?(registered_uri.to_s)
62
+ elsif type_to_check == Regexp
63
+ uris_to_check.any? { |u| u.match(registered_uri) }
64
+ end
65
+ }
66
+
67
+ if matches.size > 1
68
+ raise MultipleMatchingURIsError,
69
+ "More than one registered URI matched this request: #{method.to_s.upcase} #{uri}"
70
+ end
71
+
72
+ matches.map { |_, method_hash| method_hash[method] }.first
73
+ end
74
+
75
+
76
+ def variations_of_uri_as_strings(uri_object)
77
+ normalized_uri = normalize_uri(uri_object.dup)
78
+ normalized_uri_string = normalized_uri.to_s
79
+
80
+ variations = [normalized_uri_string]
81
+
82
+ # if the port is implied in the original, add a copy with an explicit port
83
+ if normalized_uri.default_port == normalized_uri.port
84
+ variations << normalized_uri_string.sub(
85
+ /#{Regexp.escape(normalized_uri.request_uri)}$/,
86
+ ":#{normalized_uri.port}#{normalized_uri.request_uri}")
87
+ end
88
+
89
+ variations
90
+ end
91
+
92
+ def normalize_uri(uri)
93
+ return uri if uri.is_a?(Regexp)
94
+ normalized_uri =
95
+ case uri
96
+ when URI then uri
97
+ when String
98
+ uri = 'http://' + uri unless uri.match('^https?://')
99
+ URI.parse(uri)
100
+ end
101
+ normalized_uri.query = sort_query_params(normalized_uri.query)
102
+ normalized_uri.normalize
103
+ end
104
+
105
+ def sort_query_params(query)
106
+ if query.nil? || query.empty?
107
+ nil
108
+ else
109
+ query.split('&').sort.join('&')
110
+ end
111
+ end
112
+
113
+ end
114
+ end
@@ -0,0 +1,120 @@
1
+ module FakeWeb
2
+ class Responder #:nodoc:
3
+
4
+ attr_accessor :method, :uri, :options, :times
5
+ KNOWN_OPTIONS = [:body, :exception, :response, :status].freeze
6
+
7
+ def initialize(method, uri, options, times)
8
+ self.method = method
9
+ self.uri = uri
10
+ self.options = options
11
+ self.times = times ? times : 1
12
+
13
+ if options.has_key?(:file) || options.has_key?(:string)
14
+ print_file_string_options_deprecation_warning
15
+ options[:body] = options.delete(:file) || options.delete(:string)
16
+ end
17
+ end
18
+
19
+ def response(uri, &block)
20
+ if has_baked_response?
21
+ response = baked_response
22
+ else
23
+ code, msg = meta_information
24
+ response = Net::HTTPResponse.send(:response_class, code.to_s).new("1.0", code.to_s, msg)
25
+ response.instance_variable_set(:@body, body)
26
+ headers_extracted_from_options.each { |name, value| response[name] = value }
27
+ end
28
+
29
+ # Do the uri matching again in order to get match items
30
+ uri =~ self.uri
31
+ # Using erb binding to replace original body content
32
+ response.instance_variable_set(:@body, ERB.new(response.instance_variable_get(:@body)).result(binding))
33
+ response.instance_variable_set(:@read, true)
34
+ response.extend FakeWeb::Response
35
+
36
+ optionally_raise(response)
37
+
38
+ yield response if block_given?
39
+
40
+ response
41
+ end
42
+
43
+ private
44
+
45
+ def headers_extracted_from_options
46
+ options.reject {|name, _| KNOWN_OPTIONS.include?(name) }.map { |name, value|
47
+ [name.to_s.split("_").map { |segment| segment.capitalize }.join("-"), value]
48
+ }
49
+ end
50
+
51
+ def body
52
+ return '' unless options.has_key?(:body)
53
+
54
+ options[:body] = options[:body].to_s if defined?(Pathname) && options[:body].is_a?(Pathname)
55
+
56
+ if !options[:body].include?("\0") && File.exists?(options[:body]) && !File.directory?(options[:body])
57
+ File.read(options[:body])
58
+ else
59
+ options[:body]
60
+ end
61
+ end
62
+
63
+ def baked_response
64
+ return options[:response] if options[:response].is_a?(Net::HTTPResponse)
65
+
66
+ if options[:response].is_a?(String) || (defined?(Pathname) && options[:response].is_a?(Pathname))
67
+ socket = Net::BufferedIO.new(options[:response].to_s)
68
+ r = Net::HTTPResponse.read_new(socket)
69
+
70
+ # Store the original transfer-encoding
71
+ saved_transfer_encoding = r.instance_eval {
72
+ @header['transfer-encoding'] if @header.key?('transfer-encoding')
73
+ }
74
+
75
+ # Read the body of response
76
+ r.instance_eval { @header['transfer-encoding'] = nil }
77
+ r.reading_body(socket, true) {}
78
+
79
+ # Delete the transfer-encoding key from r.@header if there wasn't one;
80
+ # otherwise, restore the saved_transfer_encoding
81
+ if saved_transfer_encoding.nil?
82
+ r.instance_eval { @header.delete('transfer-encoding') }
83
+ else
84
+ r.instance_eval { @header['transfer-encoding'] = saved_transfer_encoding }
85
+ end
86
+ r
87
+ else
88
+ raise StandardError, "Handler unimplemented for response #{options[:response]}"
89
+ end
90
+ end
91
+
92
+ def has_baked_response?
93
+ options.has_key?(:response)
94
+ end
95
+
96
+ def optionally_raise(response)
97
+ return unless options.has_key?(:exception)
98
+
99
+ case options[:exception].to_s
100
+ when "Net::HTTPError", "OpenURI::HTTPError"
101
+ raise options[:exception].new('Exception from FakeWeb', response)
102
+ else
103
+ raise options[:exception].new('Exception from FakeWeb')
104
+ end
105
+ end
106
+
107
+ def meta_information
108
+ options.has_key?(:status) ? options[:status] : [200, 'OK']
109
+ end
110
+
111
+ def print_file_string_options_deprecation_warning
112
+ which = options.has_key?(:file) ? :file : :string
113
+ $stderr.puts
114
+ $stderr.puts "Deprecation warning: FakeWeb's :#{which} option has been renamed to :body."
115
+ $stderr.puts "Just replace :#{which} with :body in your FakeWeb.register_uri calls."
116
+ $stderr.puts "Called at #{caller[6]}"
117
+ end
118
+
119
+ end
120
+ end
@@ -0,0 +1,10 @@
1
+ module FakeWeb
2
+ module Response #:nodoc:
3
+
4
+ def read_body(*args, &block)
5
+ yield @body if block_given?
6
+ @body
7
+ end
8
+
9
+ end
10
+ end
@@ -0,0 +1,15 @@
1
+ module FakeWeb
2
+ class StubSocket #:nodoc:
3
+
4
+ def initialize(*args)
5
+ end
6
+
7
+ def closed?
8
+ @closed ||= true
9
+ end
10
+
11
+ def readuntil(*args)
12
+ end
13
+
14
+ end
15
+ end
@@ -0,0 +1,65 @@
1
+ module FakeWeb
2
+ module Utility #:nodoc:
3
+
4
+ def self.decode_userinfo_from_header(header)
5
+ header.sub(/^Basic /, "").unpack("m").first
6
+ end
7
+
8
+ def self.encode_unsafe_chars_in_userinfo(userinfo)
9
+ unsafe_in_userinfo = /[^#{URI::REGEXP::PATTERN::UNRESERVED};&=+$,]|^(#{URI::REGEXP::PATTERN::ESCAPED})/
10
+ userinfo.split(":").map { |part| uri_escape(part, unsafe_in_userinfo) }.join(":")
11
+ end
12
+
13
+ def self.strip_default_port_from_uri(uri)
14
+ case uri
15
+ when %r{^http://} then uri.sub(%r{:80(/|$)}, '\1')
16
+ when %r{^https://} then uri.sub(%r{:443(/|$)}, '\1')
17
+ else uri
18
+ end
19
+ end
20
+
21
+ # Wrapper for URI escaping that switches between URI::Parser#escape and
22
+ # URI.escape for 1.9-compatibility
23
+ def self.uri_escape(*args)
24
+ if URI.const_defined?(:Parser)
25
+ URI::Parser.new.escape(*args)
26
+ else
27
+ URI.escape(*args)
28
+ end
29
+ end
30
+
31
+ def self.puts_warning_for_net_http_around_advice_libs_if_needed
32
+ libs = {"Samuel" => defined?(Samuel)}
33
+ warnings = libs.select { |_, loaded| loaded }.map do |name, _|
34
+ <<-TEXT.gsub(/ {10}/, '')
35
+ \e[1mWarning: FakeWeb was loaded after #{name}\e[0m
36
+ * #{name}'s code is being ignored when a request is handled by FakeWeb,
37
+ because both libraries work by patching Net::HTTP.
38
+ * To fix this, just reorder your requires so that FakeWeb is before #{name}.
39
+ TEXT
40
+ end
41
+ $stderr.puts "\n" + warnings.join("\n") + "\n" if warnings.any?
42
+ end
43
+
44
+ def self.record_loaded_net_http_replacement_libs
45
+ libs = {"RightHttpConnection" => defined?(RightHttpConnection)}
46
+ @loaded_net_http_replacement_libs = libs.map { |name, loaded| name if loaded }.compact
47
+ end
48
+
49
+ def self.puts_warning_for_net_http_replacement_libs_if_needed
50
+ libs = {"RightHttpConnection" => defined?(RightHttpConnection)}
51
+ warnings = libs.select { |_, loaded| loaded }.
52
+ reject { |name, _| @loaded_net_http_replacement_libs.include?(name) }.
53
+ map do |name, _|
54
+ <<-TEXT.gsub(/ {10}/, '')
55
+ \e[1mWarning: #{name} was loaded after FakeWeb\e[0m
56
+ * FakeWeb's code is being ignored, because #{name} replaces parts of
57
+ Net::HTTP without deferring to other libraries. This will break Net::HTTP requests.
58
+ * To fix this, just reorder your requires so that #{name} is before FakeWeb.
59
+ TEXT
60
+ end
61
+ $stderr.puts "\n" + warnings.join("\n") + "\n" if warnings.any?
62
+ end
63
+
64
+ end
65
+ end
@@ -0,0 +1,2 @@
1
+ # So you can require "fakeweb" instead of "fake_web"
2
+ require "fake_web"
@@ -0,0 +1,12 @@
1
+ HTTP/1.1 200 OK
2
+ Cache-Control: private, max-age=0
3
+ Date: Sun, 01 Feb 2009 02:16:24 GMT
4
+ Expires: -1
5
+ Content-Type: text/html; charset=ISO-8859-1
6
+ Set-Cookie: PREF=ID=a6d9b5f5a4056dfe:TM=1233454584:LM=1233454584:S=U9pSwSu4eQwOPenX; expires=Tue, 01-Feb-2011 02:16:24 GMT; path=/; domain=.google.com
7
+ Server: gws
8
+ Transfer-Encoding: chunked
9
+
10
+ <html><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><title>Google</title><script>var _gjwl=location;function _gjuc(){var a=_gjwl.hash;if(a.indexOf("&q=")>0||a.indexOf("#q=")>=0){a=a.substring(1);if(a.indexOf("#")==-1){for(var c=0;c<a.length;){var d=c;if(a.charAt(d)=="&")++d;var b=a.indexOf("&",d);if(b==-1)b=a.length;var e=a.substring(d,b);if(e.indexOf("fp=")==0){a=a.substring(0,c)+a.substring(b,a.length);b=c}else if(e=="cad=h")return 0;c=b}_gjwl.href="search?"+a+"&cad=h";return 1}}return 0};
11
+ window._gjuc && location.hash && _gjuc();</script><style>body,td,a,p,.h{font-family:arial,sans-serif}.h{color:#36c;font-size:20px}.q{color:#00c}.ts td{padding:0}.ts{border-collapse:collapse}#gbar{height:22px;padding-left:2px}.gbh,.gbd{border-top:1px solid #c9d7f1;font-size:1px}.gbh{height:0;position:absolute;top:24px;width:100%}#gbi,#gbs{background:#fff;left:0;position:absolute;top:24px;visibility:hidden;z-index:1000}#gbi{border:1px solid;border-color:#c9d7f1 #36c #36c #a2bae7;z-index:1001}#guser{padding-bottom:7px !important}#gbar,#guser{font-size:13px;padding-top:1px !important}@media all{.gb1,.gb3{height:22px;margin-right:.73em;vertical-align:top}#gbar{float:left}}.gb2{display:block;padding:.2em .5em}a.gb1,a.gb2,a.gb3{color:#00c !important}.gb2,.gb3{text-decoration:none}a.gb2:hover{background:#36c;color:#fff !important}</style><script>window.google={kEI:"-AWFSZ6qFYuUswO9j5HIDQ",kEXPI:"17259,19547",kHL:"en"};
12
+ google.y={};google.x=function(e,g){google.y[e.id]=[e,g];return false};window.gbar={};(function(){var b=window.gbar,f,h;b.qs=function(a){var c=window.encodeURIComponent&&(document.forms[0].q||"").value;if(c)a.href=a.href.replace(/([?&])q=[^&]*|$/,function(i,g){return(g||"&")+"q="+encodeURIComponent(c)})};function j(a,c){a.visibility=h?"hidden":"visible";a.left=c+"px"}b.tg=function(a){a=a||window.event;var c=0,i,g=window.navExtra,d=document.getElementById("gbi"),e=a.target||a.srcElement;a.cancelBubble=true;if(!f){f=document.createElement(Array.every||window.createPopup?"iframe":"div");f.frameBorder="0";f.src="#";d.parentNode.appendChild(f).id="gbs";if(g)for(i in g)d.insertBefore(g[i],d.firstChild).className="gb2";document.onclick=b.close}if(e.className!="gb3")e=e.parentNode;do c+=e.offsetLeft;while(e=e.offsetParent);j(d.style,c);f.style.width=d.offsetWidth+"px";f.style.height=d.offsetHeight+"px";j(f.style,c);h=!h};b.close=function(a){h&&b.tg(a)}})();</script></head><body bgcolor=#ffffff text=#000000 link=#0000cc vlink=#551a8b alink=#ff0000 onload="document.f.q.focus();if(document.images)new Image().src='/images/nav_logo3.png'" topmargin=3 marginheight=3><div id=gbar><nobr><b class=gb1>Web</b> <a href="http://images.google.com/imghp?hl=en&tab=wi" onclick=gbar.qs(this) class=gb1>Images</a> <a href="http://maps.google.com/maps?hl=en&tab=wl" onclick=gbar.qs(this) class=gb1>Maps</a> <a href="http://news.google.com/nwshp?hl=en&tab=wn" onclick=gbar.qs(this) class=gb1>News</a> <a href="http://www.google.com/prdhp?hl=en&tab=wf" onclick=gbar.qs(this) class=gb1>Shopping</a> <a href="http://mail.google.com/mail/?hl=en&tab=wm" class=gb1>Gmail</a> <a href="http://www.google.com/intl/en/options/" onclick="this.blur();gbar.tg(event);return !1" class=gb3><u>more</u> <small>&#9660;</small></a><div id=gbi> <a href="http://video.google.com/?hl=en&tab=wv" onclick=gbar.qs(this) class=gb2>Video</a> <a href="http://groups.google.com/grphp?hl=en&tab=wg" onclick=gbar.qs(this) class=gb2>Groups</a> <a href="http://books.google.com/bkshp?hl=en&tab=wp" onclick=gbar.qs(this) class=gb2>Books</a> <a href="http://scholar.google.com/schhp?hl=en&tab=ws" onclick=gbar.qs(this) class=gb2>Scholar</a> <a href="http://finance.google.com/finance?hl=en&tab=we" onclick=gbar.qs(this) class=gb2>Finance</a> <a href="http://blogsearch.google.com/?hl=en&tab=wb" onclick=gbar.qs(this) class=gb2>Blogs</a> <div class=gb2><div class=gbd></div></div> <a href="http://www.youtube.com/?hl=en&tab=w1" onclick=gbar.qs(this) class=gb2>YouTube</a> <a href="http://www.google.com/calendar/render?hl=en&tab=wc" class=gb2>Calendar</a> <a href="http://picasaweb.google.com/home?hl=en&tab=wq" onclick=gbar.qs(this) class=gb2>Photos</a> <a href="http://docs.google.com/?hl=en&tab=wo" class=gb2>Documents</a> <a href="http://www.google.com/reader/view/?hl=en&tab=wy" class=gb2>Reader</a> <a href="http://sites.google.com/?hl=en&tab=w3" class=gb2>Sites</a> <div class=gb2><div class=gbd></div></div> <a href="http://www.google.com/intl/en/options/" class=gb2>even more &raquo;</a></div> </nobr></div><div class=gbh style=left:0></div><div class=gbh style=right:0></div><div align=right id=guser style="font-size:84%;padding:0 0 4px" width=100%><nobr><a href="/url?sa=p&pref=ig&pval=3&q=http://www.google.com/ig%3Fhl%3Den%26source%3Diglk&usg=AFQjCNFA18XPfgb7dKnXfKz7x7g1GDH1tg">iGoogle</a> | <a href="https://www.google.com/accounts/Login?continue=http://www.google.com/&hl=en">Sign in</a></nobr></div><center><br clear=all id=lgpd><img alt="Google" height=110 src="/intl/en_ALL/images/logo.gif" width=276><br><br><form action="/search" name=f><table cellpadding=0 cellspacing=0><tr valign=top><td width=25%>&nbsp;</td><td align=center nowrap><input name=hl type=hidden value=en><input type=hidden name=ie value="ISO-8859-1"><input autocomplete="off" maxlength=2048 name=q size=55 title="Google Search" value=""><br><input name=btnG type=submit value="Google Search"><input name=btnI type=submit value="I'm Feeling Lucky"></td><td nowrap width=25%><font size=-2>&nbsp;&nbsp;<a href=/advanced_search?hl=en>Advanced Search</a><br>&nbsp;&nbsp;<a href=/preferences?hl=en>Preferences</a><br>&nbsp;&nbsp;<a href=/language_tools?hl=en>Language Tools</a></font></td></tr></table></form><br><font size=-1>Share what you know. <a href="/aclk?sa=L&ai=CYhslHwSFSZH6LIHusAPEsc2eBfv77nqP3YC9CsHZnNkTEAEgwVRQypDftPn_____AWDJBqoECU_QbUVlfOdxZw&num=1&sig=AGiWqtwRgqw8y_kza6RGKxBrCstaXkDJ7A&q=http://knol.google.com">Write a Knol</a>.</font><br><br><br><font size=-1><a href="/intl/en/ads/">Advertising&nbsp;Programs</a> - <a href="/services/">Business Solutions</a> - <a href="/intl/en/about.html">About Google</a></font><p><font size=-2>&copy;2009 - <a href="/intl/en/privacy.html">Privacy</a></font></p></center></body><script>if(google.y)google.y.first=[];window.setTimeout(function(){var xjs=document.createElement('script');xjs.src='/extern_js/f/CgJlbhICdXMgACswCjgVLCswDjgELCswGDgDLA/L3N5xu59nDE.js';document.getElementsByTagName('head')[0].appendChild(xjs)},0);google.y.first.push(function(){google.ac.i(document.f,document.f.q,'','')})</script><script>function _gjp() {!(location.hash && _gjuc()) && setTimeout(_gjp, 500);}window._gjuc && _gjp();</script></html>
@@ -0,0 +1,17 @@
1
+ HTTP/1.1 200 OK
2
+ Cache-Control: private, max-age=0
3
+ Date: Sun, 01 Feb 2009 01:54:36 GMT
4
+ Expires: -1
5
+ Content-Type: text/html; charset=ISO-8859-1
6
+ Set-Cookie: PREF=ID=4320bcaa30d097de:TM=1233453276:LM=1233453276:S=Eio39bg_nIabTxzL; expires=Tue, 01-Feb-2011 01:54:36 GMT; path=/; domain=.google.com
7
+ Server: gws
8
+ Transfer-Encoding: chunked
9
+
10
+ fef
11
+ <html><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><title>Google</title><script>var _gjwl=location;function _gjuc(){var a=_gjwl.hash;if(a.indexOf("&q=")>0||a.indexOf("#q=")>=0){a=a.substring(1);if(a.indexOf("#")==-1){for(var c=0;c<a.length;){var d=c;if(a.charAt(d)=="&")++d;var b=a.indexOf("&",d);if(b==-1)b=a.length;var e=a.substring(d,b);if(e.indexOf("fp=")==0){a=a.substring(0,c)+a.substring(b,a.length);b=c}else if(e=="cad=h")return 0;c=b}_gjwl.href="search?"+a+"&cad=h";return 1}}return 0};
12
+ window._gjuc && location.hash && _gjuc();</script><style>body,td,a,p,.h{font-family:arial,sans-serif}.h{color:#36c;font-size:20px}.q{color:#00c}.ts td{padding:0}.ts{border-collapse:collapse}#gbar{height:22px;padding-left:2px}.gbh,.gbd{border-top:1px solid #c9d7f1;font-size:1px}.gbh{height:0;position:absolute;top:24px;width:100%}#gbi,#gbs{background:#fff;left:0;position:absolute;top:24px;visibility:hidden;z-index:1000}#gbi{border:1px solid;border-color:#c9d7f1 #36c #36c #a2bae7;z-index:1001}#guser{padding-bottom:7px !important}#gbar,#guser{font-size:13px;padding-top:1px !important}@media all{.gb1,.gb3{height:22px;margin-right:.73em;vertical-align:top}#gbar{float:left}}.gb2{display:block;padding:.2em .5em}a.gb1,a.gb2,a.gb3{color:#00c !important}.gb2,.gb3{text-decoration:none}a.gb2:hover{background:#36c;color:#fff !important}</style><script>window.google={kEI:"3ACFSYC6EKTcswOL4_nBDQ",kEXPI:"17259,19463",kHL:"en"};
13
+ google.y={};google.x=function(e,g){google.y[e.id]=[e,g];return false};window.gbar={};(function(){var b=window.gbar,f,h;b.qs=function(a){var c=window.encodeURIComponent&&(document.forms[0].q||"").value;if(c)a.href=a.href.replace(/([?&])q=[^&]*|$/,function(i,g){return(g||"&")+"q="+encodeURIComponent(c)})};function j(a,c){a.visibility=h?"hidden":"visible";a.left=c+"px"}b.tg=function(a){a=a||window.event;var c=0,i,g=window.navExtra,d=document.getElementById("gbi"),e=a.target||a.srcElement;a.cancelBubble=true;if(!f){f=document.createElement(Array.every||window.createPopup?"iframe":"div");f.frameBorder="0";f.src="#";d.parentNode.appendChild(f).id="gbs";if(g)for(i in g)d.insertBefore(g[i],d.firstChild).className="gb2";document.onclick=b.close}if(e.className!="gb3")e=e.parentNode;do c+=e.offsetLeft;while(e=e.offsetParent);j(d.style,c);f.style.width=d.offsetWidth+"px";f.style.height=d.offsetHeight+"px";j(f.style,c);h=!h};b.close=function(a){h&&b.tg(a)}})();</script></head><body bgcolor=#ffffff text=#000000 link=#0000cc vlink=#551a8b alink=#ff0000 onload="document.f.q.focus();if(document.images)new Image().src='/images/nav_logo3.png'" topmargin=3 marginheight=3><div id=gbar><nobr><b class=gb1>Web</b> <a href="http://images.google.com/imghp?hl=en&tab=wi" onclick=gbar.qs(this) class=gb1>Images</a> <a href="http://maps.google.com/maps?hl=en&tab=wl" onclick=gbar.qs(this) class=gb1>Maps</a> <a href="http://news.google.com/nwshp?hl=en&tab=wn" onclick=gbar.qs(this) class=gb1>News</a> <a href="http://www.google.com/prdhp?hl=en&tab=wf" onclick=gbar.qs(this) class=gb1>Shopping</a> <a href="http://mail.google.com/mail/?hl=en&tab=wm" class=gb1>Gmail</a> <a href="http://www.google.com/intl/en/options/" onclick="this.blur();gbar.tg(event);return !1" class=gb3><u>more</u> <small>&#9660;</small></a><div id=gbi> <a href="http://video.google.com/?hl=en&tab=wv" onclick=gbar.qs(this) class=gb2>Video</a> <a href="http://groups.google.com/grphp?hl=en&tab=wg" onclick=gbar.qs(this) class=gb2>Groups</a> <a href="http://books.google.com/bkshp?hl=en&tab=wp" onclick=gbar.qs(this) class=gb2>Books</a> <a href="http://scholar.google.com/schhp?hl=en&tab=ws" onclick=gbar.qs(this) class=gb2>Scholar</a> <a href="http://finance.google.com/finance?hl=en&tab=we" onclick=gbar.qs(this) class=gb2>Finance</a> <a href="http://blogsearch.google.com/?hl=en&tab=wb" onclick=gbar.qs(this) class=gb2>Blogs</a> <div class=gb2><div class=gbd></div></div> <a href="http://www.youtube.com/?hl=en&tab=w1" onclick=gbar.qs(this) class=gb2>YouTube</a> <a href="http://www.google.com/calendar/render?hl=en&tab=wc" class=gb2>Calendar</a> <a href="http
14
+ a27
15
+ ://picasaweb.google.com/home?hl=en&tab=wq" onclick=gbar.qs(this) class=gb2>Photos</a> <a href="http://docs.google.com/?hl=en&tab=wo" class=gb2>Documents</a> <a href="http://www.google.com/reader/view/?hl=en&tab=wy" class=gb2>Reader</a> <a href="http://sites.google.com/?hl=en&tab=w3" class=gb2>Sites</a> <div class=gb2><div class=gbd></div></div> <a href="http://www.google.com/intl/en/options/" class=gb2>even more &raquo;</a></div> </nobr></div><div class=gbh style=left:0></div><div class=gbh style=right:0></div><div align=right id=guser style="font-size:84%;padding:0 0 4px" width=100%><nobr><a href="/url?sa=p&pref=ig&pval=3&q=http://www.google.com/ig%3Fhl%3Den%26source%3Diglk&usg=AFQjCNFA18XPfgb7dKnXfKz7x7g1GDH1tg">iGoogle</a> | <a href="https://www.google.com/accounts/Login?continue=http://www.google.com/&hl=en">Sign in</a></nobr></div><center><br clear=all id=lgpd><img alt="Google" height=110 src="/intl/en_ALL/images/logo.gif" width=276><br><br><form action="/search" name=f><table cellpadding=0 cellspacing=0><tr valign=top><td width=25%>&nbsp;</td><td align=center nowrap><input name=hl type=hidden value=en><input type=hidden name=ie value="ISO-8859-1"><input autocomplete="off" maxlength=2048 name=q size=55 title="Google Search" value=""><br><input name=btnG type=submit value="Google Search"><input name=btnI type=submit value="I'm Feeling Lucky"></td><td nowrap width=25%><font size=-2>&nbsp;&nbsp;<a href=/advanced_search?hl=en>Advanced Search</a><br>&nbsp;&nbsp;<a href=/preferences?hl=en>Preferences</a><br>&nbsp;&nbsp;<a href=/language_tools?hl=en>Language Tools</a></font></td></tr></table></form><br><font size=-1>Share what you know. <a href="/aclk?sa=L&ai=CFL7HzwCFSZCnCJSwsQPm842HB_v77nqP3YC9CsHZnNkTEAEgwVRQypDftPn_____AWDJBqoECU_Q1sTewQNSbw&num=1&sig=AGiWqtyz-UiOD3EpsSp4k3n8A7zooeg48g&q=http://knol.google.com">Write a Knol</a>.</font><br><br><br><font size=-1><a href="/intl/en/ads/">Advertising&nbsp;Programs</a> - <a href="/services/">Business Solutions</a> - <a href="/intl/en/about.html">About Google</a></font><p><font size=-2>&copy;2009 - <a href="/intl/en/privacy.html">Privacy</a></font></p></center></body><script>if(google.y)google.y.first=[];window.setTimeout(function(){var xjs=document.createElement('script');xjs.src='/extern_js/f/CgJlbhICdXMgACswCjgVLCswDjgELCswGDgDLA/L3N5xu59nDE.js';document.getElementsByTagName('head')[0].appendChild(xjs)},0);google.y.first.push(function(){google.ac.i(document.f,document.f.q,'','')})</script><script>function _gjp() {!(location.hash && _gjuc()) && setTimeout(_gjp, 500);}window._gjuc && _gjp();</script></html>
16
+ 0
17
+