Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #18 from doitian/issue/17_bererror_unsupported_obj…

…ect_type_id_139

Do not add controls when it is empty. Fixed #17
  • Loading branch information...
commit a1bf790784876575b67f247646024f0b9e807100 2 parents 6bb9fa6 + f102f50
@RoryO RoryO authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/net/ldap.rb
View
4 lib/net/ldap.rb
@@ -1394,9 +1394,9 @@ def search(args = {})
false.to_ber,
rfc2696_cookie.map{ |v| v.to_ber}.to_ber_sequence.to_s.to_ber
].to_ber_sequence if paged_searches_supported
- controls = controls.to_ber_contextspecific(0)
+ controls = controls.empty? ? nil : controls.to_ber_contextspecific(0)
- pkt = [next_msgid.to_ber, request, controls].to_ber_sequence
+ pkt = [next_msgid.to_ber, request, controls].compact.to_ber_sequence
@conn.write pkt
result_code = 0
Please sign in to comment.
Something went wrong with that request. Please try again.