Revert SSL issue on Multipart to force Chunk mode if isMultipart is true
This commit is contained in:
parent
258f5b00fa
commit
666bf1ffe4
@ -59,11 +59,6 @@ public class HttpPostRequestEncoder implements ChunkedInput {
|
||||
*/
|
||||
private boolean isChunked;
|
||||
|
||||
/**
|
||||
* Force chunked for instance to cover when the size could be bigger due to SSL/TLS
|
||||
*/
|
||||
private boolean forceChunked;
|
||||
|
||||
/**
|
||||
* InterfaceHttpData for Body (without encoding)
|
||||
*/
|
||||
@ -103,7 +98,7 @@ public class HttpPostRequestEncoder implements ChunkedInput {
|
||||
public HttpPostRequestEncoder(HttpRequest request, boolean multipart)
|
||||
throws ErrorDataEncoderException {
|
||||
this(new DefaultHttpDataFactory(DefaultHttpDataFactory.MINSIZE),
|
||||
request, multipart, HttpConstants.DEFAULT_CHARSET, false);
|
||||
request, multipart, HttpConstants.DEFAULT_CHARSET);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -116,38 +111,9 @@ public class HttpPostRequestEncoder implements ChunkedInput {
|
||||
*/
|
||||
public HttpPostRequestEncoder(HttpDataFactory factory, HttpRequest request, boolean multipart)
|
||||
throws ErrorDataEncoderException {
|
||||
this(factory, request, multipart, HttpConstants.DEFAULT_CHARSET, false);
|
||||
this(factory, request, multipart, HttpConstants.DEFAULT_CHARSET);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param request the request to encode
|
||||
* @param multipart True if the FORM is a ENCTYPE="multipart/form-data"
|
||||
* @param chunkeForce to allow chunk mode even if not detected to be so (SSL issue)
|
||||
* @throws NullPointerException for request
|
||||
* @throws ErrorDataEncoderException if the request is not a POST
|
||||
*/
|
||||
public HttpPostRequestEncoder(HttpRequest request, boolean multipart, boolean chunkeForce)
|
||||
throws ErrorDataEncoderException {
|
||||
this(new DefaultHttpDataFactory(DefaultHttpDataFactory.MINSIZE),
|
||||
request, multipart, HttpConstants.DEFAULT_CHARSET, chunkeForce);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param factory the factory used to create InterfaceHttpData
|
||||
* @param request the request to encode
|
||||
* @param multipart True if the FORM is a ENCTYPE="multipart/form-data"
|
||||
* @param chunkeForce to allow chunk mode even if not detected to be so (SSL issue)
|
||||
* @throws NullPointerException for request and factory
|
||||
* @throws ErrorDataEncoderException if the request is not a POST
|
||||
*/
|
||||
public HttpPostRequestEncoder(HttpDataFactory factory, HttpRequest request, boolean multipart, boolean chunkeForce)
|
||||
throws ErrorDataEncoderException {
|
||||
this(factory, request, multipart, HttpConstants.DEFAULT_CHARSET, chunkeForce);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param factory the factory used to create InterfaceHttpData
|
||||
@ -159,20 +125,6 @@ public class HttpPostRequestEncoder implements ChunkedInput {
|
||||
*/
|
||||
public HttpPostRequestEncoder(HttpDataFactory factory, HttpRequest request,
|
||||
boolean multipart, Charset charset) throws ErrorDataEncoderException {
|
||||
this(factory, request, multipart, charset, false);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param factory the factory used to create InterfaceHttpData
|
||||
* @param request the request to encode
|
||||
* @param multipart True if the FORM is a ENCTYPE="multipart/form-data"
|
||||
* @param charset the charset to use as default
|
||||
* @param chunkeForce to allow chunk mode even if not detected to be so (SSL issue)
|
||||
* @throws NullPointerException for request or charset or factory
|
||||
* @throws ErrorDataEncoderException if the request is not a POST
|
||||
*/
|
||||
public HttpPostRequestEncoder(HttpDataFactory factory, HttpRequest request,
|
||||
boolean multipart, Charset charset, boolean chunkeForce) throws ErrorDataEncoderException {
|
||||
if (factory == null) {
|
||||
throw new NullPointerException("factory");
|
||||
}
|
||||
@ -194,7 +146,6 @@ public class HttpPostRequestEncoder implements ChunkedInput {
|
||||
isLastChunk = false;
|
||||
isLastChunkSent = false;
|
||||
isMultipart = multipart;
|
||||
this.forceChunked = forceChunked;
|
||||
multipartHttpDatas = new ArrayList<InterfaceHttpData>();
|
||||
if (isMultipart) {
|
||||
initDataMultipart();
|
||||
@ -677,7 +628,7 @@ public class HttpPostRequestEncoder implements ChunkedInput {
|
||||
}
|
||||
request.setHeader(HttpHeaders.Names.CONTENT_LENGTH, String
|
||||
.valueOf(realSize));
|
||||
if (realSize > HttpPostBodyUtil.chunkSize || forceChunked) {
|
||||
if (realSize > HttpPostBodyUtil.chunkSize || isMultipart) {
|
||||
isChunked = true;
|
||||
if (transferEncoding != null) {
|
||||
request.removeHeader(HttpHeaders.Names.TRANSFER_ENCODING);
|
||||
|
Loading…
Reference in New Issue
Block a user