mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-03 17:27:33 +08:00
整理代码
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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=";
|
||||
|
||||
Reference in New Issue
Block a user