@libfintech/api-gateway-plugin 0.1.20 → 0.1.22

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.
Files changed (2) hide show
  1. package/authe/index.js +5 -5
  2. package/package.json +2 -2
package/authe/index.js CHANGED
@@ -11,7 +11,7 @@ const {ResponseError} = require("@libfintech/api-gateway-core/error/response_err
11
11
  const sessionIdPrefix = appConfig.session.sessionIdPrefix;
12
12
  const accountIdPrefix = appConfig.session.accountIdPrefix;
13
13
  //不能有大写,客户端传值时,均为小写
14
- const sessionIdKeyName = appConfig.session.sessionIdKeyName;
14
+ const sessionIdKeyName = appConfig.session.sessionIdKeyName.toLowerCase();
15
15
  //会话最长过期时间(一天),单位:秒
16
16
  const maxExpirationTime = appConfig.session.maxExpirationTime;
17
17
 
@@ -26,7 +26,7 @@ function getCookies(cookie) {
26
26
  if (cookie) {
27
27
  cookie.split(";").forEach(l => {
28
28
  let parts = l.split("=");
29
- cookies[parts[0].trim()] = (parts[1] || "").trim();
29
+ cookies[parts[0].toLowerCase().trim()] = (parts[1] || "").trim();
30
30
  });
31
31
  }
32
32
 
@@ -238,9 +238,9 @@ async function main(pipeline, configs) {
238
238
  req.headers = {};
239
239
 
240
240
  // 防止人为注入
241
- delete req.headers["X-Session"];
242
- delete req.headers["X-Account-Id"];
243
- delete req.headers["X-Wechat-Open-Id"];
241
+ delete req.headers["x-session"];
242
+ delete req.headers["x-account-id"];
243
+ delete req.headers["x-wechat-open-id"];
244
244
 
245
245
  if (session) {
246
246
  //注入X-Session
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libfintech/api-gateway-plugin",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "description": "api gateway plugin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,7 +9,7 @@
9
9
  "author": "liamjung",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@libfintech/api-gateway-core": "^0.1.9",
12
+ "@libfintech/api-gateway-core": "^0.1.28",
13
13
  "co-wechat": "^2.3.0",
14
14
  "ejs": "^2.6.1",
15
15
  "wechat-crypto": "0.0.2"