This commit is contained in:
Looly
2021-08-12 00:19:22 +08:00
parent 884ac2e765
commit 05c679bfc5
4 changed files with 7 additions and 6 deletions

View File

@@ -17,7 +17,6 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.body.MultipartBody;
import cn.hutool.http.cookie.GlobalCookieManager;
import cn.hutool.http.ssl.SSLSocketFactoryBuilder;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLSocketFactory;
@@ -883,7 +882,7 @@ public class HttpRequest extends HttpBase<HttpRequest> {
*
* @param protocol 协议
* @return this
* @see SSLSocketFactoryBuilder
* @see SSLUtil#createSSLContext(String)
* @see #setSSLSocketFactory(SSLSocketFactory)
*/
public HttpRequest setSSLProtocol(String protocol) {

View File

@@ -467,7 +467,7 @@ public class HttpResponse extends HttpBase<HttpResponse> implements Closeable {
final FastByteArrayOutputStream out = contentLength > 0 ?
new FastByteArrayOutputStream(contentLength) : new FastByteArrayOutputStream();
try {
IoUtil.copy(in, out, -1, -1, null);
IoUtil.copy(in, out, -1, contentLength, null);
} catch (IORuntimeException e) {
//noinspection StatementWithEmptyBody
if (e.getCause() instanceof EOFException || StrUtil.containsIgnoreCase(e.getMessage(), "Premature EOF")) {