整理代码

This commit is contained in:
xiongziliang
2020-04-04 19:55:11 +08:00
parent 67f4ca4b83
commit 11420b868b
11 changed files with 14 additions and 18 deletions

View File

@@ -71,7 +71,7 @@ void HttpClient::sendRequest(const string &strUrl, float fTimeOutSec) {
host = FindField(host.data(), NULL, ":");
}
_header.emplace("Host", host);
_header.emplace("Tools", "ZLMediaKit");
_header.emplace("Tools", SERVER_NAME);
_header.emplace("Connection", "keep-alive");
_header.emplace("Accept", "*/*");
_header.emplace("Accept-Language", "zh-CN,zh;q=0.8");

View File

@@ -398,7 +398,6 @@ static const string kContentType = "Content-Type";
static const string kContentLength = "Content-Length";
static const string kAccessControlAllowOrigin = "Access-Control-Allow-Origin";
static const string kAccessControlAllowCredentials = "Access-Control-Allow-Credentials";
static const string kServerName = SERVER_NAME;
void HttpSession::sendResponse(const char *pcStatus,
bool bClose,
@@ -426,7 +425,7 @@ void HttpSession::sendResponse(const char *pcStatus,
HttpSession::KeyValue &headerOut = const_cast<HttpSession::KeyValue &>(header);
headerOut.emplace(kDate, dateStr());
headerOut.emplace(kServer, kServerName);
headerOut.emplace(kServer, SERVER_NAME);
headerOut.emplace(kConnection, bClose ? "close" : "keep-alive");
if(!bClose){
string keepAliveString = "timeout=";