Project

General

Profile

Feature #7396 ยป open-uri_location_header.patch

zzak (Zachary Scott), 11/19/2012 12:44 PM

View differences:

lib/open-uri.rb
341 341
         Net::HTTPSeeOther, # 303
342 342
         Net::HTTPTemporaryRedirect # 307
343 343
      begin
344
        loc_uri = URI.parse(resp['location'])
344
        # Some bad formed sites responds location with unescaped special chars.
345
        # Just a new URI.encode solve this.
346
        loc_uri = URI.parse(URI.encode(resp['location']))
345 347
      rescue URI::InvalidURIError
346 348
        raise OpenURI::HTTPError.new(io.status.join(' ') + ' (Invalid Location URI)', io)
347 349
      end
348
-