diff --git a/src/Http/HttpSession.cpp b/src/Http/HttpSession.cpp index 9f2ce375..42c8cb1d 100644 --- a/src/Http/HttpSession.cpp +++ b/src/Http/HttpSession.cpp @@ -147,9 +147,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; } @@ -349,7 +355,9 @@ bool HttpSession::checkLiveStreamFlv(const function &cb){ assert(rtmp_src); if (!cb) { //找到源,发送http头,负载后续发送 - sendResponse(200, false, HttpFileManager::getContentType(".flv").data(), KeyValue(), nullptr, true); + KeyValue headerOut; + headerOut["Cache-Control"] = "no-store"; + sendResponse(200, false, HttpFileManager::getContentType(".flv").data(), headerOut, nullptr, true); } else { //自定义发送http头 cb();