Skip to content

Commit 1510945

Browse files
committed
FIX | critical bug
1 parent 85b95d8 commit 1510945

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/http/ManapiBaseHttp.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,12 @@ namespace manapi::net::http::internal {
10711071

10721072
path = manapi::filesystem::path::join(cdata->router->statics->folder, path);
10731073

1074+
if (!path.starts_with(cdata->router->statics->folder)) {
1075+
cdata->router = std::move(cdata->router->error);
1076+
send_error_response(std::move(cdata), http::NOT_FOUND_404);
1077+
return;
1078+
}
1079+
10741080
manapi::async::run([status, cdata = std::move(cdata), path = std::move(path)] () mutable
10751081
-> manapi::future<> {
10761082
bool exists = true;

0 commit comments

Comments
 (0)