From 642c9c075a3cde3185ad9d92cf78abfe9bf4e9c1 Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Fri, 11 Feb 2022 15:14:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=BE=E7=BD=AEcookie?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Http/HttpFileManager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Http/HttpFileManager.cpp b/src/Http/HttpFileManager.cpp index b01edbe0..c8a1ebed 100644 --- a/src/Http/HttpFileManager.cpp +++ b/src/Http/HttpFileManager.cpp @@ -393,7 +393,7 @@ static void accessFile(TcpSession &sender, const Parser &parser, const MediaInfo //文件鉴权失败 StrCaseMap headerOut; if (cookie) { - headerOut["Set-Cookie"] = cookie->getAttach()._path; + headerOut["Set-Cookie"] = cookie->getCookie(cookie->getAttach()._path); } cb(401, "text/html", headerOut, std::make_shared(errMsg)); return; @@ -402,7 +402,7 @@ static void accessFile(TcpSession &sender, const Parser &parser, const MediaInfo auto response_file = [file_exist, is_hls](const HttpServerCookie::Ptr &cookie, const HttpFileManager::invoker &cb, const string &strFile, const Parser &parser) { StrCaseMap httpHeader; if (cookie) { - httpHeader["Set-Cookie"] = cookie->getAttach()._path; + httpHeader["Set-Cookie"] = cookie->getCookie(cookie->getAttach()._path); } HttpSession::HttpResponseInvoker invoker = [&](int code, const StrCaseMap &headerOut, const HttpBody::Ptr &body) { if (cookie && file_exist) { @@ -519,7 +519,7 @@ void HttpFileManager::onAccessPath(TcpSession &sender, Parser &parser, const Htt } StrCaseMap headerOut; if (cookie) { - headerOut["Set-Cookie"] = cookie->getAttach()._path; + headerOut["Set-Cookie"] = cookie->getCookie(cookie->getAttach()._path); } cb(errMsg.empty() ? 200 : 401, "text/html", headerOut, std::make_shared(strMenu)); });