Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No longer neccessary to call String#freeze on string literals. #154

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/net/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1798,7 +1798,7 @@ def proxy_from_env?
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
Expand Down
8 changes: 4 additions & 4 deletions lib/net/http/generic_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def initialize(m, reqbody, resbody, uri_or_path, initheader = nil) # :nodoc:
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
Expand Down Expand Up @@ -212,15 +212,15 @@ def update_uri(addr, port, ssl) # :nodoc: internal use only
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
Expand Down