fix(analyzer): extract loginPath/mainPath as bootstrap fallback
When HTML/JS contains loginPath or mainPath variables (common in 95598 and similar scenes), extract the domain as expected_domain and the full URL as target_url. This fixes the bootstrap_resolved gate failure for scenes that use loginPath/mainPath instead of meta tags or explicit bootstrap configuration. 🤖 Generated with [Qoder][https://qoder.com]
This commit is contained in:
@@ -445,14 +445,21 @@ function collectBootstrapHints(files, indexHtml) {
|
||||
|
||||
for (const file of files) {
|
||||
const namedUrlMatches = file.content.matchAll(
|
||||
/\b(sourceUrl|sourceURL|baseUrl|baseURL|targetUrl|requestUrl|apiUrl|gatewayUrl)\b\s*[:=]\s*(['"`])(https?:\/\/[^'"`\s]+)\2/gi
|
||||
/\b(sourceUrl|sourceURL|baseUrl|baseURL|targetUrl|requestUrl|apiUrl|gatewayUrl|loginPath|mainPath)\b\s*[:=]\s*(['"`])(https?:\/\/[^'"`\s]+)\2/gi
|
||||
);
|
||||
for (const match of namedUrlMatches) {
|
||||
const url = match[3];
|
||||
const type = String(match[1] || "").toLowerCase();
|
||||
if (url && !seen.has(url)) {
|
||||
seen.add(url);
|
||||
hints.push({ type, url, path: file.path });
|
||||
// loginPath/mainPath are bootstrap hints — the domain is expected_domain
|
||||
if (type === "loginpath" || type === "mainpath") {
|
||||
const domain = new URL(url).hostname;
|
||||
hints.push({ type: "expected_domain", value: domain, path: file.path });
|
||||
hints.push({ type: "target_url", value: url, path: file.path });
|
||||
} else {
|
||||
hints.push({ type, url, path: file.path });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user