@@ -148,7 +148,7 @@ def initialize(scheme: nil, user: nil, password: nil, host: nil,
148148 # @api public
149149 # @return [TrueClass, FalseClass] are the URIs equivalent (after normalization)?
150150 def ==( other )
151- other . is_a? ( URI ) && String ( normalize ) == String ( other . normalize )
151+ other . is_a? ( URI ) && String ( normalize ) . eql? ( String ( other . normalize ) )
152152 end
153153
154154 # Are these URI objects equal without normalization
@@ -162,7 +162,7 @@ def ==(other)
162162 # @api public
163163 # @return [TrueClass, FalseClass] are the URIs equivalent?
164164 def eql? ( other )
165- other . is_a? ( URI ) && String ( self ) == String ( other )
165+ other . is_a? ( URI ) && String ( self ) . eql? ( String ( other ) )
166166 end
167167
168168 # Hash value based off the normalized form of a URI
@@ -221,7 +221,7 @@ def default_port
221221 # @api public
222222 # @return [String] origin of the URI
223223 def origin
224- port_suffix = ":#{ port } " unless port == default_port
224+ port_suffix = ":#{ port } " unless port . eql? ( default_port )
225225 "#{ String ( @scheme ) . downcase } ://#{ String ( @raw_host ) . downcase } #{ port_suffix } "
226226 end
227227
@@ -282,7 +282,7 @@ def normalize
282282 user : @user ,
283283 password : @password ,
284284 host : @raw_host &.downcase ,
285- port : ( @port unless port == default_port ) ,
285+ port : ( @port unless port . eql? ( default_port ) ) ,
286286 path : @path . empty? && @raw_host ? "/" : @path ,
287287 query : @query ,
288288 fragment : @fragment
@@ -298,7 +298,7 @@ def normalize
298298 # @return [True] if URI is HTTP
299299 # @return [False] otherwise
300300 def http?
301- HTTP_SCHEME == @scheme
301+ HTTP_SCHEME . eql? ( @scheme )
302302 end
303303
304304 # Checks whether the URI scheme is HTTPS
@@ -310,7 +310,7 @@ def http?
310310 # @return [True] if URI is HTTPS
311311 # @return [False] otherwise
312312 def https?
313- HTTPS_SCHEME == @scheme
313+ HTTPS_SCHEME . eql? ( @scheme )
314314 end
315315
316316 # Duplicates the URI object
0 commit comments