manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1493058 - in /manifoldcf/trunk: CHANGES.txt connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/ModifiedHttpSolrServer.java
Date Fri, 14 Jun 2013 13:18:36 GMT
Author: kwright
Date: Fri Jun 14 13:18:36 2013
New Revision: 1493058

URL: http://svn.apache.org/r1493058
Log:
Possible fix for CONNECTORS-623.

Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/ModifiedHttpSolrServer.java

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1493058&r1=1493057&r2=1493058&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Fri Jun 14 13:18:36 2013
@@ -3,6 +3,9 @@ $Id$
 
 ======================= 1.3-dev =====================
 
+CONNECTORS-623: Use UTF-8 for encoding headers in SolrJ post.
+(Shinichiro Abe, Karl Wright)
+
 CONNECTORS-716: RepositoryDocument.addField() would go into an
 infinite loop if field value was null.
 (Piergiorgio Lucidi, Karl Wright)

Modified: manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/ModifiedHttpSolrServer.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/ModifiedHttpSolrServer.java?rev=1493058&r1=1493057&r2=1493058&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/ModifiedHttpSolrServer.java
(original)
+++ manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/ModifiedHttpSolrServer.java
Fri Jun 14 13:18:36 2013
@@ -66,7 +66,7 @@ import org.apache.solr.common.util.Conte
 import org.apache.solr.common.util.NamedList;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
+import java.nio.charset.Charset;
 
 /** This class overrides and somewhat changes the behavior of the
 * SolrJ HttpSolrServer class.  The point of all this is simply to get
@@ -84,6 +84,21 @@ public class ModifiedHttpSolrServer exte
   private static final String UTF_8 = "UTF-8";
   private static final String DEFAULT_PATH = "/select";
 
+  private static Charset UTF8_CHARSET;
+  static
+  {
+    try
+    {
+      UTF8_CHARSET = Charset.forName(UTF_8);
+    }
+    catch (Exception e)
+    {
+      e.printStackTrace();
+      System.exit(-100);
+      UTF8_CHARSET = null;
+    }
+  }
+  
   private final HttpClient httpClient;
   private boolean followRedirects = false;
   private int maxRetries = 0;
@@ -192,7 +207,7 @@ public class ModifiedHttpSolrServer exte
               }
               
               if (parts.size() > 0) {
-                MultipartEntity entity = new MultipartEntity(HttpMultipartMode.STRICT);
+                MultipartEntity entity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE,
null, UTF8_CHARSET);
                 for(FormBodyPart p: parts) {
                   entity.addPart(p);
                 }



Mime
View raw message