node-easywechat 3.5.19 → 3.5.20

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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
3
 
4
+ ## v3.5.20 (2024-03-12)
5
+
6
+ - Fix: 限制仅post请求才解析请求体
7
+
4
8
  ## v3.5.19 (2023-12-26)
5
9
 
6
10
  - Fix: 工具包对外暴露PublicKey和PrivateKey
@@ -138,7 +138,7 @@ class ServerRequest {
138
138
  static createFromIncomingMessage(req, body = null) {
139
139
  return __awaiter(this, void 0, void 0, function* () {
140
140
  let request = new ServerRequest(req.method, req.url, req.headers || {}, body, req.httpVersion);
141
- if (!body) {
141
+ if (req.method.toUpperCase() === 'POST' && !body) {
142
142
  let res = yield (0, raw_body_1.default)(req);
143
143
  request.withBody(res);
144
144
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-easywechat",
3
- "version": "3.5.19",
3
+ "version": "3.5.20",
4
4
  "description": "EasyWechat SDK for Node.js (NOT OFFICIAL)",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {