From 3d2fd42f292f36cfdcb8a9d116ad1f9e5c33aa35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BE=E9=B8=A3?= <94030128+ixingqiao@users.noreply.github.com> Date: Tue, 30 May 2023 14:24:54 +0800 Subject: [PATCH] Update HttpSession.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 调整Cache-Control:no-cache的控制范围仅对ws-flv部分生效 --- src/Http/HttpSession.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Http/HttpSession.cpp b/src/Http/HttpSession.cpp index df524c1c..160ba8e9 100644 --- a/src/Http/HttpSession.cpp +++ b/src/Http/HttpSession.cpp @@ -148,9 +148,15 @@ bool HttpSession::checkWebSocket(){ _live_over_websocket = 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 - if (checkLiveStreamFlv(res_cb)) { + if (checkLiveStreamFlv(res_cb_flv)) { //这里是websocket-flv直播请求 return true; }