{"record":{"id":"5d4d7f7c9d6d122e","repo":"santifer/career-ops","slug":"invalid-or-blocked-url-rejected-reason","errorCode":null,"errorMessage":"Invalid or blocked URL: ${rejected.reason}","messagePattern":"Invalid or blocked URL: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"batch-evaluate-gemini.mjs","lineNumber":195,"sourceCode":"═══════════════════════════════════════════════════════\n1. You do NOT have access to WebSearch, Playwright, or file writing tools.\n2. Generate Blocks A through G in full, in English.\n3. Output a machine-readable summary block in this exact format:\n\n---SCORE_SUMMARY---\nCOMPANY: <company name>\nROLE: <role title>\nSCORE: <global score as decimal, e.g. 3.8>\nARCHETYPE: <detected archetype>\nLEGITIMACY: <High Confidence | Proceed with Caution | Suspicious>\n---END_SUMMARY---\n`;\n}\n\nasync function scrapeUrl(browser, url) {\n  const rejected = rejectPrivateOrInvalid(url);\n  if (rejected) {\n    throw new Error(`Invalid or blocked URL: ${rejected.reason}`);\n  }\n  \n  const page = await browser.newPage();\n  try {\n    await page.route('**/*', (route) => {\n      const targetUrl = route.request().url();\n      const interceptedRejected = rejectPrivateOrInvalid(targetUrl);\n      if (interceptedRejected) {\n        return route.abort('accessdenied');\n      }\n      return route.continue();\n    });\n\n    await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 30000 });\n    \n    const finalRejected = rejectPrivateOrInvalid(page.url());\n    if (finalRejected) {\n      throw new Error(`Invalid or blocked URL after redirect: ${finalRejected.reason}`);","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/batch-evaluate-gemini.mjs#L177-L213","documentation":"SSRF guard in the Gemini batch evaluator's scraper: rejectPrivateOrInvalid() flagged the URL before navigation, so the request was never made. It fires for malformed/unparseable URLs or addresses that resolve into private/loopback/internal ranges (e.g. http://localhost, 127.x, 10.x, 169.254.x, file: schemes). The interpolated reason names which check failed; the input at fault is the URL taken from the batch input line.","triggerScenarios":"Thrown at batch-evaluate-gemini.mjs:195 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix or replace the offending URL in the batch input file with a public HTTPS job-posting URL","Remove internal/localhost links from the batch list — the evaluator only scrapes publicly reachable pages","If the target is genuinely public, check for a typo, a non-http scheme, or a hostname that DNS-resolves to a private range"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"aac998c7ed7248ea853b720ceeb1fdbeb322fc5d","analyzedAt":"2026-09-16T06:35:29.214Z","contentChangedAt":"2026-09-16T06:35:29.214Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}