mirror of https://github.com/apache/lucene.git
Fix issue in CommonsHttpSolrServer where a Reader is copied to an OutputStream using default encoding
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1066889 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7b32753293
commit
69ad01cb98
|
@ -20,7 +20,6 @@ package org.apache.solr.client.solrj.impl;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.Reader;
|
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
@ -335,11 +334,11 @@ public class CommonsHttpSolrServer extends SolrServer
|
||||||
@Override
|
@Override
|
||||||
protected void sendData(OutputStream out)
|
protected void sendData(OutputStream out)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
Reader reader = c.getReader();
|
InputStream in = c.getStream();
|
||||||
try {
|
try {
|
||||||
IOUtils.copy(reader, out);
|
IOUtils.copy(in, out);
|
||||||
} finally {
|
} finally {
|
||||||
reader.close();
|
in.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue