From f590ef177e05cff287db176160ca7ef26a7f8543 Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Thu, 21 Mar 2013 18:04:28 +0000
Subject: [PATCH] Partial fix for OPENDJ-694: Implement HTTP BASIC authentication

---
 opendj3/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2LDAP.java |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/opendj3/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2LDAP.java b/opendj3/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2LDAP.java
index 11f43c4..b69da29 100644
--- a/opendj3/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2LDAP.java
+++ b/opendj3/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2LDAP.java
@@ -660,10 +660,14 @@
         // Parse secondary data center(s).
         final JsonValue secondaryLDAPServers = configuration.get("secondaryLDAPServers");
         final ConnectionFactory secondary;
-        if (secondaryLDAPServers.isList() && secondaryLDAPServers.size() != 0) {
-            secondary =
-                    parseLDAPServers(secondaryLDAPServers, bindRequest, connectionPoolSize,
-                            heartBeatIntervalSeconds);
+        if (secondaryLDAPServers.isList()) {
+            if (secondaryLDAPServers.size() > 0) {
+                secondary =
+                        parseLDAPServers(secondaryLDAPServers, bindRequest, connectionPoolSize,
+                                heartBeatIntervalSeconds);
+            } else {
+                secondary = null;
+            }
         } else if (!secondaryLDAPServers.isNull()) {
             throw new IllegalArgumentException("Invalid secondaryLDAPServers configuration");
         } else {

--
Gitblit v1.10.0