yakuza0 2.22.38 → 2.22.39-beta.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yakuza0",
3
- "version": "2.22.38",
3
+ "version": "2.22.39-beta.1",
4
4
  "description": "yakuza0 with nuxt",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -68,6 +68,14 @@ export default (ctx, inject) => {
68
68
  global.__yk_gu__[variable.guRouteVerHeader] = req.headers[variable.guRouteVerHeader] || global.__yk_gu__[variable.guRouteVerHeader];
69
69
  defaults.headers[variable.adjoinIpHeader] = req.headers[variable.adjoinIpHeader];
70
70
  defaults.headers[variable.forwardedForHeader] = req.headers[variable.forwardedForHeader];
71
+
72
+ if (!req.headers.Cookie || (typeof req.headers.Cookie === "string" && req.headers.Cookie.indexOf(variable.csrfCookie) === -1)) {
73
+ if (typeof req.headers.Cookie === "string" && req.headers.Cookie.length > 0) {
74
+ defaults.headers.Cookie = req.headers.Cookie + '; ' + global.__http_bd__;
75
+ } else {
76
+ defaults.headers.Cookie = global.__http_bd__;
77
+ }
78
+ }
71
79
  }
72
80
  }
73
81
  }
package/utils/secret.js CHANGED
@@ -62,6 +62,7 @@ var secret = {};
62
62
  // import {asymmetric, getKey, symmetry} from "yakuza1/lib/encrypt/sm";
63
63
 
64
64
  _yakuza.global.__yk_gu__ = _yakuza.global.__yk_gu__ || {};
65
+ _yakuza.global.__http_bd__ = _yakuza.global.__http_bd__ || '';
65
66
 
66
67
  // const allowHeaders = {
67
68
  // 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36',
@@ -303,7 +304,7 @@ var set = exports.set = function set(_ref3) {
303
304
 
304
305
  getUc = function () {
305
306
  var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4() {
306
- var ucBody, _spi, _spiQuery, _spiSecret, defDomain, bodyStr, Cookie, ucHeaders, hs, rs, resCookie;
307
+ var ucBody, _spi, _spiQuery, _spiSecret, defDomain, bodyStr, Cookie, ucHeaders, hs, rs, resCookie, resCookieArr;
307
308
 
308
309
  return _regenerator2.default.wrap(function _callee4$(_context4) {
309
310
  while (1) {
@@ -359,12 +360,15 @@ var set = exports.set = function set(_ref3) {
359
360
  resCookie = rs.headers.get(hs);
360
361
 
361
362
  if (resCookie) {
362
- ucResC = _yakuza._.compact(resCookie.split(',').map(function (r) {
363
+ resCookieArr = resCookie.split(',');
364
+
365
+ ucResC = _yakuza._.compact(resCookieArr.map(function (r) {
363
366
  var rt = r.substring(0, r.indexOf(";"));
364
367
  var at = rt.split("=");
365
368
  return at[1] ? rt : false;
366
- })).join(";");
367
- res.setHeader(hs, resCookie.split(','));
369
+ })).join("; ");
370
+ _yakuza.global.__http_bd__ += ucResC;
371
+ res.setHeader(hs, resCookieArr);
368
372
  }
369
373
  _context4.next = 22;
370
374
  break;