[ruby/net-http] No longer neccessary to call String#freeze
on string literals.
See #144 https://github.com/ruby/net-http/commit/5a986c13d3
This commit is contained in:
parent
465c222ef1
commit
e77c766b7a
@ -1798,7 +1798,7 @@ module Net #:nodoc:
|
|||||||
def proxy_uri # :nodoc:
|
def proxy_uri # :nodoc:
|
||||||
return if @proxy_uri == false
|
return if @proxy_uri == false
|
||||||
@proxy_uri ||= URI::HTTP.new(
|
@proxy_uri ||= URI::HTTP.new(
|
||||||
"http".freeze, nil, address, port, nil, nil, nil, nil, nil
|
"http", nil, address, port, nil, nil, nil, nil, nil
|
||||||
).find_proxy || false
|
).find_proxy || false
|
||||||
@proxy_uri || nil
|
@proxy_uri || nil
|
||||||
end
|
end
|
||||||
|
@ -23,7 +23,7 @@ class Net::HTTPGenericRequest
|
|||||||
raise ArgumentError, "no host component for URI" unless (hostname && hostname.length > 0)
|
raise ArgumentError, "no host component for URI" unless (hostname && hostname.length > 0)
|
||||||
@uri = uri_or_path.dup
|
@uri = uri_or_path.dup
|
||||||
host = @uri.hostname.dup
|
host = @uri.hostname.dup
|
||||||
host << ":".freeze << @uri.port.to_s if @uri.port != @uri.default_port
|
host << ":" << @uri.port.to_s if @uri.port != @uri.default_port
|
||||||
@path = uri_or_path.request_uri
|
@path = uri_or_path.request_uri
|
||||||
raise ArgumentError, "no HTTP request path given" unless @path
|
raise ArgumentError, "no HTTP request path given" unless @path
|
||||||
else
|
else
|
||||||
@ -212,15 +212,15 @@ class Net::HTTPGenericRequest
|
|||||||
return unless @uri
|
return unless @uri
|
||||||
|
|
||||||
if ssl
|
if ssl
|
||||||
scheme = 'https'.freeze
|
scheme = 'https'
|
||||||
klass = URI::HTTPS
|
klass = URI::HTTPS
|
||||||
else
|
else
|
||||||
scheme = 'http'.freeze
|
scheme = 'http'
|
||||||
klass = URI::HTTP
|
klass = URI::HTTP
|
||||||
end
|
end
|
||||||
|
|
||||||
if host = self['host']
|
if host = self['host']
|
||||||
host.sub!(/:.*/m, ''.freeze)
|
host.sub!(/:.*/m, '')
|
||||||
elsif host = @uri.host
|
elsif host = @uri.host
|
||||||
else
|
else
|
||||||
host = addr
|
host = addr
|
||||||
|
Loading…
x
Reference in New Issue
Block a user