Hi, From time to time I'm getting following error:
$ gem list -r --backtrace -V *** REMOTE GEMS *** GET 304 Not Modified: http://gems.rubyforge.org/latest_specs.4.8.gz ERROR: While executing gem ... (URI::InvalidURIError) bad URI(is not URI?): Found out this is due to zenspider's patch: $ svn di -r 1806:1807 Index: lib/rubygems/remote_fetcher.rb =================================================================== --- lib/rubygems/remote_fetcher.rb (revision 1806) +++ lib/rubygems/remote_fetcher.rb (revision 1807) @@ -288,6 +288,10 @@ 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 $ svn log -r 1807 ------------------------------------------------------------------------ r1807 | zenspider | 2008-06-24 06:43:27 +0200 (Tue, 24 Jun 2008) |1 line Damn right... bitch ------------------------------------------------------------------------ When client sets 'If-Modified-Since' header, server might then response with '304 Not Modified'[1] which does not contain 'Location' field in the response header. Thus code in the RemoteFetcher#open_uri_or_path fails since Net::HTTPNotModified is subclass of Net::HTTPRedirection and the code tries to read the 'Location' field (which is `nil'). Seems to me that fix would be to revert the change in rev. 1807 or the code should handle such situation and use previously gotten latest_specs GZip in case of 304? Any ideas? Thanks, m. [1] http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection _______________________________________________ Rubygems-developers mailing list [email protected] http://rubyforge.org/mailman/listinfo/rubygems-developers
