add comment

This commit is contained in:
Looly 2021-06-11 13:47:32 +08:00
parent e2de04d36f
commit 63fc4d175b
3 changed files with 33 additions and 34 deletions

View File

@ -11,6 +11,7 @@
* 【crypto 】 MacEngine增加接口update,doFinal,reset等接口
* 【core 】 StrSpliter更名为StrSplitter
* 【core 】 NumberUtil的decimalFormat增加数字检查
* 【http 】 HttpBase的httpVersion方法设置为无效(issue#1644)
### 🐞Bug修复

View File

@ -244,8 +244,9 @@ public abstract class HttpBase<T> {
public String httpVersion() {
return httpVersion;
}
/**
* 设置http版本
* 设置http版本此方法不会影响到实际请求的HTTP版本只用于帮助判断是否connect:Keep-Alive
*
* @param httpVersion Http版本{@link HttpBase#HTTP_1_0}{@link HttpBase#HTTP_1_1}
* @return this

View File

@ -42,9 +42,6 @@ import java.util.Map;
*/
public class HttpRequest extends HttpBase<HttpRequest> {
private static final String CONTENT_TYPE_MULTIPART_PREFIX = ContentType.MULTIPART.getValue() + "; boundary=";
private static final String CONTENT_TYPE_FILE_TEMPLATE = "Content-Type: {}\r\n\r\n";
/**
* 设置全局默认的连接和读取超时时长
*
@ -387,7 +384,7 @@ public class HttpRequest extends HttpBase<HttpRequest> {
public boolean isKeepAlive() {
String connection = header(Header.CONNECTION);
if (connection == null) {
return !HTTP_1_0.equalsIgnoreCase(httpVersion);
return false == HTTP_1_0.equalsIgnoreCase(httpVersion);
}
return false == "close".equalsIgnoreCase(connection);