Skip to content
This repository was archived by the owner on Aug 2, 2020. It is now read-only.

Commit c2496de

Browse files
committed
Fix #106
1 parent 79845be commit c2496de

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/cqhttp/plugins/web/http.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@ namespace cqhttp::plugins {
112112
return;
113113
}
114114

115+
const auto authorized = authorize(access_token_, request->header, {}, [&response](auto status_code) {
116+
response->write(status_code);
117+
});
118+
if (!authorized) {
119+
logging::debug(TAG, u8"没有提供 Token 或 Token 不符,已拒绝请求");
120+
return;
121+
}
122+
115123
auto relpath = request->path_match.str(1);
116124
boost::algorithm::replace_all(relpath, "/", "\\");
117125
logging::debug(TAG, u8"收到 GET 数据文件请求,相对路径:" + relpath);

0 commit comments

Comments
 (0)