chanjs 2.0.16 → 2.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  import express from "express";
2
2
 
3
3
  let setBody = function (app, JSON_LIMIT) {
4
+ // 1. 优先解析 XML 数据(必须在 json/urlencoded 之前)
5
+ app.use(express.raw({ type: 'application/xml', limit: JSON_LIMIT }));
6
+ // 2. 再解析 JSON 和表单数据
4
7
  app.use(express.json({ limit: JSON_LIMIT }));
5
8
  app.use(express.urlencoded({ extended: false }));
6
- app.use(express.raw({ type: 'application/xml', limit: JSON_LIMIT }));
7
9
  };
8
10
 
9
- export {
10
- setBody
11
- }
11
+ export { setBody };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "chanjs",
4
- "version": "2.0.16",
4
+ "version": "2.0.17",
5
5
  "description": "chanjs基于express5 纯js研发的轻量级mvc框架。",
6
6
  "main": "index.js",
7
7
  "module": "index.js",