mirror of
https://github.com/clucraft/PriceGhost.git
synced 2026-07-14 16:32:14 +02:00
fix: remove JSON.parse on axios response (auto-parses JSON)
axios auto-parses JSON responses, so response.data is already an object. Calling JSON.parse on it throws a silent error, preventing the remote browser connection from working.
This commit is contained in:
parent
7943ec964f
commit
ea5bf6798a
1 changed files with 2 additions and 2 deletions
|
|
@ -253,8 +253,8 @@ function extractGenericCssCandidates($: CheerioAPI): PriceCandidate[] {
|
|||
async function getRemoteBrowserWSEndpoint(): Promise<string | null> {
|
||||
const remoteUrl = process.env.REMOTE_BROWSER_URL || 'http://browser-node.openclaw.svc.cluster.local:9222';
|
||||
try {
|
||||
const response = await axios.get<string>(`${remoteUrl}/json/version`, { timeout: 5000 });
|
||||
const data = JSON.parse(response.data);
|
||||
const response = await axios.get<Record<string, string>>(`${remoteUrl}/json/version`, { timeout: 5000 });
|
||||
const data = response.data; // axios auto-parses JSON
|
||||
const wsUrl = data.webSocketDebuggerUrl;
|
||||
if (wsUrl) {
|
||||
// Replace localhost with the actual remote host
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue