hch-dev commited on
Commit
ad2396e
·
verified ·
1 Parent(s): 668f062

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -3
main.py CHANGED
@@ -350,7 +350,7 @@ async def run_sandbox_endpoint(payload: SandboxRequest):
350
  "status": res.status
351
  }) if 300 <= res.status < 400 else None)
352
 
353
- await page.goto(target_url, wait_until='networkidle', timeout=30000)
354
 
355
  screenshot_name = f"screenshot_{int(time.time() * 1000)}.png"
356
  screenshot_path = os.path.join(OUTPUT_DIR, screenshot_name)
@@ -437,8 +437,7 @@ async def run_sandbox_endpoint(payload: SandboxRequest):
437
 
438
  except Exception as e:
439
  err_str = str(e)
440
- # DNS failure / unreachable host treat as suspicious, not a server crash
441
- if any(x in err_str for x in ["ERR_NAME_NOT_RESOLVED", "ERR_CONNECTION_REFUSED", "ERR_CONNECTION_TIMED_OUT", "net::", "Timeout"]):
442
  result = SandboxResult(
443
  source="url_sandbox",
444
  verdict=Verdict.SUSPICIOUS,
 
350
  "status": res.status
351
  }) if 300 <= res.status < 400 else None)
352
 
353
+ await page.goto(target_url, wait_until='networkidle', timeout=60000)
354
 
355
  screenshot_name = f"screenshot_{int(time.time() * 1000)}.png"
356
  screenshot_path = os.path.join(OUTPUT_DIR, screenshot_name)
 
437
 
438
  except Exception as e:
439
  err_str = str(e)
440
+ if any(x in err_str for x in ["ERR_NAME_NOT_RESOLVED", "ERR_CONNECTION_REFUSED", "ERR_CONNECTION_TIMED_OUT", "net::"]):
 
441
  result = SandboxResult(
442
  source="url_sandbox",
443
  verdict=Verdict.SUSPICIOUS,