diff options
author | 0x1eef <[email protected]> | 2023-09-15 03:35:34 -0300 |
---|---|---|
committer | git <[email protected]> | 2023-09-19 01:32:18 +0000 |
commit | e77c766b7ab17e801c5cfa881754c392f8c13f0b (patch) | |
tree | 7bfa38117ebc0ba8746b8e11b2b839ce545532a0 /lib | |
parent | 465c222ef125a93b1cd457d18e70a7d58454f628 (diff) |
[ruby/net-http] No longer neccessary to call `String#freeze` on string literals.
See #144
https://github.com/ruby/net-http/commit/5a986c13d3
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/http.rb | 2 | ||||
-rw-r--r-- | lib/net/http/generic_request.rb | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb index ff780b45bd..82ab6ab574 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -1798,7 +1798,7 @@ module Net #:nodoc: def proxy_uri # :nodoc: return if @proxy_uri == false @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 @proxy_uri || nil end diff --git a/lib/net/http/generic_request.rb b/lib/net/http/generic_request.rb index 9421535ceb..44e329a0c8 100644 --- a/lib/net/http/generic_request.rb +++ b/lib/net/http/generic_request.rb @@ -23,7 +23,7 @@ class Net::HTTPGenericRequest raise ArgumentError, "no host component for URI" unless (hostname && hostname.length > 0) @uri = uri_or_path.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 raise ArgumentError, "no HTTP request path given" unless @path else @@ -212,15 +212,15 @@ class Net::HTTPGenericRequest return unless @uri if ssl - scheme = 'https'.freeze + scheme = 'https' klass = URI::HTTPS else - scheme = 'http'.freeze + scheme = 'http' klass = URI::HTTP end if host = self['host'] - host.sub!(/:.*/m, ''.freeze) + host.sub!(/:.*/m, '') elsif host = @uri.host else host = addr |