{"record":{"id":"03e704daa72434f4","repo":"santifer/career-ops","slug":"agentic-jobs-url-must-use-https-url","errorCode":null,"errorMessage":"agentic-jobs: URL must use HTTPS: ${url}","messagePattern":"agentic-jobs: URL must use HTTPS: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"providers/agentic-jobs.mjs","lineNumber":47,"sourceCode":"// Wire in via a `job_boards:` entry with `provider: agentic-jobs`.\n\nconst SITE_ORIGIN = 'https://agentic-engineering-jobs.com';\nconst API_BASE = `${SITE_ORIGIN}/api/v1`;\nconst TRUSTED_HOST = 'agentic-engineering-jobs.com';\nconst PAGE_SIZE = 50; // fixed by the API (meta.per_page)\nconst MAX_PAGES = 40; // safety cap on request count (40*50 = 2000 postings)\nconst MAX_JOBS = 2000;\nconst PAGE_DELAY_MS = 2100; // stays under the documented 30 req/60s limit\n\n/** @param {string} url */\nfunction assertAgenticUrl(url) {\n  let parsed;\n  try {\n    parsed = new URL(url);\n  } catch {\n    throw new Error(`agentic-jobs: invalid URL: ${url}`);\n  }\n  if (parsed.protocol !== 'https:') throw new Error(`agentic-jobs: URL must use HTTPS: ${url}`);\n  if (parsed.hostname !== TRUSTED_HOST) {\n    throw new Error(`agentic-jobs: untrusted hostname \"${parsed.hostname}\" — must be ${TRUSTED_HOST}`);\n  }\n  return url;\n}\n\nconst regionNames = new Intl.DisplayNames(['en'], { type: 'region' });\n\n/**\n * Resolve a two-letter ISO country code to an English name. Returns '' for\n * anything that isn't a resolvable two-letter code. Exported for tests.\n * @param {unknown} code\n */\nexport function countryName(code) {\n  if (typeof code !== 'string' || !/^[A-Za-z]{2}$/.test(code)) return '';\n  try {\n    const name = regionNames.of(code.toUpperCase());\n    return name && name !== code.toUpperCase() ? name : '';","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/santifer/career-ops/blob/9b17a8ac97b398a496b38e423ae24e433b43254f/providers/agentic-jobs.mjs#L29-L65","documentation":"After parse, assertAgenticUrl() requires the protocol be exactly 'https:'. Non-https schemes are rejected as a transport-security / SSRF control for this server-side fetch. Fires for http://, ftp://, file://, data://, etc.","triggerScenarios":"The agentic-jobs API URL uses http:// or another non-https scheme — typically API_BASE set to its http variant.","commonSituations":"API_BASE copied from an http bookmark; local http dev mirror used as the endpoint.","solutions":["Switch the scheme to https — use 'https://agentic-engineering-jobs.com/api'.","For a local non-https test mirror, mock fetchJson in tests rather than pointing the provider at http."],"exampleFix":"// before\nconst API_BASE = 'http://agentic-engineering-jobs.com/api';\n\n// after\nconst API_BASE = 'https://agentic-engineering-jobs.com/api';","handlingStrategy":"validation","validationCode":"function isHttpsUrl(u) {\n  try { return new URL(u).protocol === 'https:'; } catch { return false; }\n}\nif (!isHttpsUrl(API_BASE)) throw new Error('agentic-jobs API must be https');","typeGuard":"/** @param {unknown} u @returns {u is string} */\nfunction isHttpsUrlString(u) {\n  if (typeof u !== 'string') return false;\n  try { return new URL(u).protocol === 'https:'; } catch { return false; }\n}","tryCatchPattern":"try { assertAgenticUrl(url); } catch (err) {\n  if (/must use HTTPS/.test(err.message)) console.error('agentic-jobs API must be https.');\n  throw err;\n}","preventionTips":["CI-enforce https for all provider API constants.","Respect the API's documented rate limit (30 req/60s); the provider paces via PAGE_DELAY_MS."],"tags":["agentic-jobs","https","ssrf-guard","provider","security","url"],"backgroundTag":null,"analyzedSha":"9b17a8ac97b398a496b38e423ae24e433b43254f","analyzedAt":"2026-08-13T00:48:39.135Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}