Skip to content

Commit 757b044

Browse files
committed
feat(http):为FileDownloaderMiddleware添加unsetPathMapping()接口
1 parent 76d8d81 commit 757b044

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

modules/http/server/middlewares/file_downloader_middleware.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,11 @@ void FileDownloaderMiddleware::setPathMapping(const std::string& url, const std:
237237
d_->path_mappings[url] = file;
238238
}
239239

240+
void FileDownloaderMiddleware::unsetPathMapping(const std::string& url)
241+
{
242+
d_->path_mappings.erase(url);
243+
}
244+
240245
void FileDownloaderMiddleware::setDefaultMimeType(const std::string& mime_type)
241246
{
242247
d_->default_mime_type = mime_type;

modules/http/server/middlewares/file_downloader_middleware.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ class FileDownloaderMiddleware : public Middleware {
7979
* \param file 文件路径
8080
*/
8181
void setPathMapping(const std::string& url, const std::string& file);
82+
/**
83+
* 取消路径映射
84+
*
85+
* \param url URL路径
86+
*/
87+
void unsetPathMapping(const std::string& url);
8288

8389
/**
8490
* 设置默认的MIME类型

version.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
# TBOX版本号
2222
TBOX_VERSION_MAJOR := 1
2323
TBOX_VERSION_MINOR := 14
24-
TBOX_VERSION_REVISION := 3
24+
TBOX_VERSION_REVISION := 4

0 commit comments

Comments
 (0)