@tuya-sat/micro-dev-proxy 3.0.27-beta.25 → 3.0.27-beta.26
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/dist/appProxy.js +3 -3
- package/dist/util.js +3 -3
- package/package.json +1 -1
package/dist/appProxy.js
CHANGED
|
@@ -39,7 +39,7 @@ exports.GSdf = void 0;
|
|
|
39
39
|
const globalAxios_1 = __importDefault(require("./globalAxios"));
|
|
40
40
|
const js_sha256_1 = require("js-sha256");
|
|
41
41
|
const csrf_1 = __importStar(require("./csrf"));
|
|
42
|
-
const initLogin_1 =
|
|
42
|
+
const initLogin_1 = __importDefault(require("./initLogin"));
|
|
43
43
|
const token_1 = __importDefault(require("./token"));
|
|
44
44
|
const util_1 = require("./util");
|
|
45
45
|
const url_1 = require("url");
|
|
@@ -51,7 +51,7 @@ const mf = fs.existsSync(mfPath) && JSON.parse(fs.readFileSync(mfPath, 'utf8'));
|
|
|
51
51
|
let SDF;
|
|
52
52
|
function parse_SDF(html) {
|
|
53
53
|
var _a;
|
|
54
|
-
const REGEX = /(?<=window._SDF=).*?}(
|
|
54
|
+
const REGEX = /(?<=window._SDF=).*?}(?=(;|<\/script>))/;
|
|
55
55
|
return ((_a = REGEX.exec(html)) === null || _a === void 0 ? void 0 : _a[0]) || '';
|
|
56
56
|
}
|
|
57
57
|
function GSdf() {
|
|
@@ -131,7 +131,7 @@ class AppProxy {
|
|
|
131
131
|
if (csrf_1.COOKIE_CSRF === key) {
|
|
132
132
|
return false;
|
|
133
133
|
}
|
|
134
|
-
if (
|
|
134
|
+
if (('connect.sid' === key || 'sid' === key) && !this.isMainApp) {
|
|
135
135
|
return false;
|
|
136
136
|
}
|
|
137
137
|
return true;
|
package/dist/util.js
CHANGED
|
@@ -20,8 +20,8 @@ function logFactory(isLog) {
|
|
|
20
20
|
exports.logFactory = logFactory;
|
|
21
21
|
function parseSetCookie(setCookie, key) {
|
|
22
22
|
const targetCookie = setCookie
|
|
23
|
-
.map((cookieInfo) => cookieInfo.split(
|
|
24
|
-
.find((cookie) => cookie.split(
|
|
25
|
-
return targetCookie ||
|
|
23
|
+
.map((cookieInfo) => cookieInfo.split(';')[0])
|
|
24
|
+
.find((cookie) => cookie.split('=')[0] === 'connect.sid' || cookie.split('=')[0] === 'sid');
|
|
25
|
+
return targetCookie || '';
|
|
26
26
|
}
|
|
27
27
|
exports.parseSetCookie = parseSetCookie;
|