q-koa 13.8.33 → 13.8.34

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.
@@ -96,7 +96,9 @@ const validateUnionNotifySign = ({ notifyData, signType, publicKey, md5Key }) =>
96
96
  const params = { ...notifyData }
97
97
  const sign = String(params.sign)
98
98
  delete params.sign
99
- delete params.signType // signType 本身不参与签名原文
99
+ // 通联回调报文字段是全小写 signtype;同时删除大小写两种做防御
100
+ delete params.signType
101
+ delete params.signtype
100
102
 
101
103
  // 通联 buildSignStr:按 ASCII 字典序拼接,跳过空/undefined/null
102
104
  const sortedKeys = Object.keys(params).sort()
@@ -1534,8 +1536,8 @@ exports.union_notify = async (ctx) => {
1534
1536
  return
1535
1537
  }
1536
1538
 
1537
- // 优先按回调带的 signType 决定算法,没有则退到配置 union_signType,再退 RSA
1538
- const rawSignType = (notifyData.signType || union_signType || 'RSA').toUpperCase()
1539
+ // 通联回调报文字段为全小写 signtype;兼容大小写两种 + 配置 union_signType;末位回退 RSA
1540
+ const rawSignType = (notifyData.signtype || notifyData.signType || union_signType || 'RSA').toUpperCase()
1539
1541
  const hasSign = notifyData.sign !== undefined && notifyData.sign !== ''
1540
1542
  const trxstatus = notifyData.trxstatus
1541
1543
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "13.8.33",
3
+ "version": "13.8.34",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {