质量保障

This commit is contained in:
stapxs committed 2025-01-09 13:42:55 +08:00
1 parent 88fd1f9eb1
commit a3088fb8bc
2 files changed
+11 -33

No files matched your search

+10 -6
View File
@@ -82,12 +82,7 @@ export class OB11PassiveHttpAdapter extends IOB11NetworkAdapter<HttpServerConfig
}
}
async handleRequest(req: Request, res: Response) {
if (!this.isEnable) {
this.core.context.logger.log(`[OneBot] [HTTP Server Adapter] Server is closed`);
return res.json(OB11Response.error('Server is closed', 200));
}
async httpApiRequest(req: Request, res: Response) {
let payload = req.body;
if (req.method == 'get') {
payload = req.query;
@@ -113,6 +108,15 @@ export class OB11PassiveHttpAdapter extends IOB11NetworkAdapter<HttpServerConfig
}
}
async handleRequest(req: Request, res: Response) {
if (!this.isEnable) {
this.core.context.logger.log(`[OneBot] [HTTP Server Adapter] Server is closed`);
return res.json(OB11Response.error('Server is closed', 200));
}
return this.httpApiRequest(req, res);
}
async reload(newConfig: HttpServerConfig) {
const wasEnabled = this.isEnable;
const oldPort = this.config.port;