新增downloadFile接口,支持下载限定目录下任意文件 (#3073)

This commit is contained in:
夏楚
2023-12-02 15:58:40 +08:00
committed by GitHub
parent e1f199c986
commit 10c2197e76
4 changed files with 90 additions and 0 deletions

View File

@@ -725,6 +725,9 @@ void HttpResponseInvokerImp::responseFile(const StrCaseMap &requestHeader,
return;
}
// 尝试添加Content-Type
httpHeader.emplace("Content-Type", HttpConst::getHttpContentType(file.data()));
auto &strRange = const_cast<StrCaseMap &>(requestHeader)["Range"];
int code = 200;
if (!strRange.empty()) {