manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1538884 - /manifoldcf/integration/elasticsearch/trunk/src/main/java/org/apache/manifoldcf/elasticsearch/MCFAuthorizer.java
Date Tue, 05 Nov 2013 07:16:21 GMT
Author: kwright
Date: Tue Nov  5 07:16:21 2013
New Revision: 1538884

URL: http://svn.apache.org/r1538884
Log:
Make code backwards compatible with earlier versions of MCF.

Modified:
    manifoldcf/integration/elasticsearch/trunk/src/main/java/org/apache/manifoldcf/elasticsearch/MCFAuthorizer.java

Modified: manifoldcf/integration/elasticsearch/trunk/src/main/java/org/apache/manifoldcf/elasticsearch/MCFAuthorizer.java
URL: http://svn.apache.org/viewvc/manifoldcf/integration/elasticsearch/trunk/src/main/java/org/apache/manifoldcf/elasticsearch/MCFAuthorizer.java?rev=1538884&r1=1538883&r2=1538884&view=diff
==============================================================================
--- manifoldcf/integration/elasticsearch/trunk/src/main/java/org/apache/manifoldcf/elasticsearch/MCFAuthorizer.java
(original)
+++ manifoldcf/integration/elasticsearch/trunk/src/main/java/org/apache/manifoldcf/elasticsearch/MCFAuthorizer.java
Tue Nov  5 07:16:21 2013
@@ -242,8 +242,16 @@ public class MCFAuthorizer
           urlBuffer.append("?");
         else
           urlBuffer.append("&");
-        urlBuffer.append("username_").append(Integer.toString(i)).append("=").append(URLEncoder.encode(domainMap.get(domain),"utf-8")).append("&")
-          .append("domain_").append(Integer.toString(i)).append("=").append(URLEncoder.encode(domain,"utf-8"));
+        // For backwards compatibility, handle the singleton case specially
+        if (domainMap.size() == 1 && domain.length() == 0)
+        {
+          urlBuffer.append("username=").append(URLEncoder.encode(domainMap.get(domain),"utf-8"));
+        }
+        else
+        {
+          urlBuffer.append("username_").append(Integer.toString(i)).append("=").append(URLEncoder.encode(domainMap.get(domain),"utf-8")).append("&")
+            .append("domain_").append(Integer.toString(i)).append("=").append(URLEncoder.encode(domain,"utf-8"));
+        }
         i++;
       }
       String theURL = urlBuffer.toString();



Mime
View raw message