fix(pl24): prefix basePath for relative P4 hrefs in fetchP4Page
Some checks failed
QA Gate (P0/P1) / Test affected app (pull_request) Has been cancelled

Volvo vin-group.action categories store hrefs relative to the catalog dir
(e.g. "vin-group.action?group1=…"). fetchP4Page did `${baseUrl}${url}`,
collapsing to "partslink24.comvin-group.action" → ENOTFOUND. Prefix the
service basePath when the path is relative. Fixes Volvo subgroup drilling
for existing (relative) stored linkPaths without a re-decode.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-02 02:12:59 +03:00
parent 497aba24ab
commit 7208069a80

View File

@@ -3157,7 +3157,15 @@ export class PL24FordLegacyService {
isFullUrl = false,
account: "tr" | "de" = "tr",
): Promise<string | null> {
const fullUrl = isFullUrl ? url : `${this.baseUrl}${url}`;
// Some catalogs (Volvo vin-group.action) store hrefs relative to the catalog
// directory (e.g. "vin-group.action?group1=…"). Prefix the service basePath
// so `${baseUrl}${path}` doesn't collapse into "partslink24.comvin-group…".
let path = url;
if (!isFullUrl && !path.startsWith("/")) {
const cfg = getServiceConfig(serviceName);
if (cfg) path = `${cfg.basePath}/${serviceName}/${path}`;
}
const fullUrl = isFullUrl ? url : `${this.baseUrl}${path}`;
const headers = await this.authService.buildFordLegacyHeadersForAccount(serviceName, account);
const dispatcher = await this.authService.getProxyAgent4Account(account);