|
|
|
@ -39,6 +39,7 @@ import org.apache.http.client.methods.HttpPost;
|
|
|
|
|
import org.apache.http.client.methods.HttpRequestBase;
|
|
|
|
|
import org.apache.http.conn.ssl.NoopHostnameVerifier;
|
|
|
|
|
import org.apache.http.cookie.SM;
|
|
|
|
|
import org.apache.http.entity.BufferedHttpEntity;
|
|
|
|
|
import org.apache.http.entity.ContentType;
|
|
|
|
|
import org.apache.http.entity.InputStreamEntity;
|
|
|
|
|
import org.apache.http.entity.StringEntity;
|
|
|
|
@ -422,14 +423,14 @@ public class HandlerUtil {
|
|
|
|
|
entityBuilder.addTextBody(item.getFieldName(), item.getString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
proxyRequest.setEntity(entityBuilder.build());
|
|
|
|
|
proxyRequest.setEntity(new BufferedHttpEntity(entityBuilder.build()));
|
|
|
|
|
HandlerUtil.copyRequestHeaders(req, proxyRequest, false);
|
|
|
|
|
} else {
|
|
|
|
|
if (StringUtils.isNotEmpty(req.getHeader(HttpHeaders.CONTENT_LENGTH)) ||
|
|
|
|
|
StringUtils.isNotEmpty(req.getHeader(HttpHeaders.TRANSFER_ENCODING))) {
|
|
|
|
|
InputStreamEntity entity = new InputStreamEntity(req.getInputStream(),
|
|
|
|
|
Long.parseLong(req.getHeader(HttpHeaders.CONTENT_LENGTH)));
|
|
|
|
|
proxyRequest.setEntity(entity);
|
|
|
|
|
proxyRequest.setEntity(new BufferedHttpEntity(entity));
|
|
|
|
|
}
|
|
|
|
|
HandlerUtil.copyRequestHeaders(req, proxyRequest, true);
|
|
|
|
|
}
|
|
|
|
|