fix: http server cors

This commit is contained in:
linyuchen
2024-04-17 17:06:24 +08:00
parent 662813cc58
commit 24a1ffd652
3 changed files with 6 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
import express, { Express, Request, Response } from 'express';
import cors from 'cors';
import http from 'http';
import { log } from '../utils/log';
import { ob11Config } from '@/onebot11/config';
@@ -12,6 +13,7 @@ export abstract class HttpServerBase {
constructor() {
this.expressAPP = express();
this.expressAPP.use(cors());
this.expressAPP.use(express.urlencoded({ extended: true, limit: '5000mb' }));
this.expressAPP.use((req, res, next) => {
// 兼容处理没有带content-type的请求