Skip to content

Commit 7c61cef

Browse files
author
Tom Maher
committed
s/@uri/@url/g because RFCs 2255 and 4516 say "URL" exclusively
1 parent 6c9ce50 commit 7c61cef

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/net/ldap.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -547,19 +547,19 @@ def self.result2string(code) #:nodoc:
547547
def initialize(args = {})
548548
# URI.parse('') returns a valid URI object, but with all its
549549
# attributes set to nil. This is convenient for chained '||'
550-
@uri = URI.parse(args[:uri] || '')
550+
@url = URI.parse(args[:uri] || '')
551551

552-
unless [nil, 'ldaps', 'ldap'].include? @uri.scheme
552+
unless [nil, 'ldaps', 'ldap'].include? @url.scheme
553553
raise ProtocolNotSupported,
554-
"scheme '#{@uri.scheme}' unsupported, use 'ldap' or 'ldaps'"
554+
"scheme '#{@url.scheme}' unsupported, use 'ldap' or 'ldaps'"
555555
end
556-
@host = args[:host] || @uri.host || DefaultHost
557-
@port = args[:port] || @uri.port || DefaultPort
556+
@host = args[:host] || @url.host || DefaultHost
557+
@port = args[:port] || @url.port || DefaultPort
558558
@hosts = args[:hosts]
559559
@verbose = false # Make this configurable with a switch on the class.
560560
@auth = args[:auth] || DefaultAuth
561-
@base = args[:base] || if @uri.path && @uri.path.length > 1
562-
URI.decode(@uri.path[1..-1])
561+
@base = args[:base] || if @url.path && @url.path.length > 1
562+
URI.decode(@url.path[1..-1])
563563
else
564564
DefaultTreebase
565565
end
@@ -1348,7 +1348,7 @@ def normalize_encryption(args)
13481348
"encryption may be hash, nil, or one of [:simple_tls, :start_tls, true]"
13491349

13501350
if args.nil?
1351-
return nil unless @uri.scheme == 'ldaps'
1351+
return nil unless @url.scheme == 'ldaps'
13521352
{ method: :simple_tls,
13531353
tls_options: OpenSSL::SSL::SSLContext::DEFAULT_PARAMS }
13541354
elsif args.is_a? Hash
@@ -1359,7 +1359,7 @@ def normalize_encryption(args)
13591359
{ method: method,
13601360
tls_options: {} }
13611361
when :true
1362-
scheme = if @uri.scheme == 'ldaps' || @port == DefaultTlsPort
1362+
scheme = if @url.scheme == 'ldaps' || @port == DefaultTlsPort
13631363
:simple_tls
13641364
else
13651365
:start_tls

0 commit comments

Comments
 (0)