Update HttpSession.cpp

调整Cache-Control:no-cache的控制范围仅对ws-flv部分生效
This commit is contained in:
百鸣 2023-05-30 14:24:54 +08:00 committed by GitHub
parent 0dc95cb85b
commit 3d2fd42f29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -148,9 +148,15 @@ bool HttpSession::checkWebSocket(){
_live_over_websocket = true; _live_over_websocket = true;
sendResponse(101, false, nullptr, headerOut, nullptr, true); sendResponse(101, false, nullptr, headerOut, nullptr, true);
}; };
auto res_cb_flv = [this, header = std::move(headerOut)]() mutable {
_live_over_websocket = true;
header.emplace("Cache-Control", "no-store");
sendResponse(101, false, nullptr, header, nullptr, true);
};
//判断是否为websocket-flv //判断是否为websocket-flv
if (checkLiveStreamFlv(res_cb)) { if (checkLiveStreamFlv(res_cb_flv)) {
//这里是websocket-flv直播请求 //这里是websocket-flv直播请求
return true; return true;
} }