lib/www/mechanize/chain/header_resolver.rb in mechanize-0.8.4 vs lib/www/mechanize/chain/header_resolver.rb in mechanize-0.8.5

- old
+ new

@@ -21,10 +21,10 @@ else request['Connection'] = 'close' end request['Accept-Encoding'] = 'gzip,identity' request['Accept-Language'] = 'en-us,en;q=0.5' - host = "#{uri.host}#{uri.port.to_i == 80 ? '' : ':' + uri.port.to_s}" + host = "#{uri.host}#{[80, 443].include?(uri.port.to_i) ? '' : ':' + uri.port.to_s}" request['Host'] = host request['Accept-Charset'] = 'ISO-8859-1,utf-8;q=0.7,*;q=0.7' unless @cookie_jar.empty?(uri) cookies = @cookie_jar.cookies(uri)