Permalink
Browse files

Jackass committed code that didn't have a failing test\!... oh, and g…

…ot the other failures passing. PINGish

git-svn-id: http://rubygems.rubyforge.org/svn/trunk@1805 3d4018f9-ac1a-0410-99e9-8a154d859a19
  • Loading branch information...
1 parent 4a87136 commit 1ea87efd06326d32400ef6e094b079f902bdb5bf zenspider committed Jun 24, 2008
Showing with 4 additions and 8 deletions.
  1. +4 −8 lib/rubygems/remote_fetcher.rb
@@ -248,20 +248,20 @@ def connection_for(uri)
# Read the data from the (source based) URI, but if it is a file:// URI,
# read from the filesystem instead.
- def open_uri_or_path(uri, last_modified = nil, depth = 0, &block)
- return open(get_file_uri_path(uri), &block) if file_uri? uri
+ def open_uri_or_path(uri, last_modified = nil, depth = 0)
+ return open(get_file_uri_path(uri)) if file_uri? uri
uri = URI.parse uri unless URI::Generic === uri
response = request uri, Net::HTTP::Get, last_modified
case response
when Net::HTTPOK then
- block.call(StringIO.new(response.body)) if block
+ response.body
when Net::HTTPRedirection then
raise FetchError.new('too many redirects', uri) if depth > 10
- open_uri_or_path(response['Location'], last_modified, depth + 1, &block)
+ open_uri_or_path(response['Location'], last_modified, depth + 1)
else
raise FetchError.new("bad response #{response.message} #{response.code}", uri)
end
@@ -288,10 +288,6 @@ def request(uri, request_class, last_modified = nil)
request.add_field 'Connection', 'keep-alive'
request.add_field 'Keep-Alive', '30'
- if last_modified then
- request.add_field 'If-Modified-Since', last_modified.rfc2822
- end
-
connection = connection_for uri
retried = false

0 comments on commit 1ea87ef

Please sign in to comment.