mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-15 14:37:36 -07:00
[Server] text/plainの場合もJSONとして解析するように
This commit is contained in:
parent
c4abdd00a3
commit
0d6b1beec0
2 changed files with 6 additions and 1 deletions
|
@ -18,7 +18,9 @@ const app = express();
|
||||||
app.disable('x-powered-by');
|
app.disable('x-powered-by');
|
||||||
app.set('etag', false);
|
app.set('etag', false);
|
||||||
app.use(bodyParser.urlencoded({ extended: true }));
|
app.use(bodyParser.urlencoded({ extended: true }));
|
||||||
app.use(bodyParser.json());
|
app.use(bodyParser.json({
|
||||||
|
type: ['application/json', 'text/plain']
|
||||||
|
}));
|
||||||
app.use(cors({
|
app.use(cors({
|
||||||
origin: true
|
origin: true
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -21,6 +21,9 @@ const app = express();
|
||||||
app.disable('x-powered-by');
|
app.disable('x-powered-by');
|
||||||
|
|
||||||
app.use(bodyParser.urlencoded({ extended: true }));
|
app.use(bodyParser.urlencoded({ extended: true }));
|
||||||
|
app.use(bodyParser.json({
|
||||||
|
type: ['application/json', 'text/plain']
|
||||||
|
}));
|
||||||
app.use(compression());
|
app.use(compression());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue