{"record":{"id":"b9b8a05244f6747d","repo":"santifer/career-ops","slug":"larajobs-url-must-use-https-url","errorCode":null,"errorMessage":"larajobs: URL must use HTTPS: ${url}","messagePattern":"larajobs: URL must use HTTPS: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"providers/larajobs.mjs","lineNumber":26,"sourceCode":"//\n// Each <item> carries the standard RSS fields plus a `job:` namespace with\n// `<job:company>` and `<job:location>`, so company and location come straight\n// from the feed (no title-splitting heuristics needed).\n//\n// Wire in via a `job_boards:` entry with `provider: larajobs`.\n\nconst FEED_URL = 'https://larajobs.com/feed';\nconst TRUSTED_HOST = 'larajobs.com';\n\n/** @param {string} url */\nfunction assertLarajobsUrl(url) {\n  let parsed;\n  try {\n    parsed = new URL(url);\n  } catch {\n    throw new Error(`larajobs: invalid URL: ${url}`);\n  }\n  if (parsed.protocol !== 'https:') throw new Error(`larajobs: URL must use HTTPS: ${url}`);\n  if (parsed.hostname !== TRUSTED_HOST) {\n    throw new Error(`larajobs: untrusted hostname \"${parsed.hostname}\" - must be ${TRUSTED_HOST}`);\n  }\n  return url;\n}\n\n// NaN-safe Date.parse - `|| undefined` would also coerce a valid epoch 0.\nfunction toEpochMs(value) {\n  if (!value) return undefined;\n  const parsed = Date.parse(value);\n  return Number.isNaN(parsed) ? undefined : parsed;\n}\n\nfunction fallbackCompany(entry) {\n  return typeof entry?.name === 'string' && entry.name.trim() ? entry.name.trim() : 'LaraJobs';\n}\n\n/** @type {Provider} */","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/santifer/career-ops/blob/9b17a8ac97b398a496b38e423ae24e433b43254f/providers/larajobs.mjs#L8-L44","documentation":"After the URL parses successfully, assertLarajobsUrl verifies parsed.protocol === 'https:'. Any other scheme (http:, ftp:, file:, javascript:) triggers this error. It enforces transport encryption before the feed is fetched.","triggerScenarios":"The URL string begins with http:// (plain HTTP), ftp://, file://, or any non-https scheme. Most commonly an http:// URL was configured for a feed that must be fetched over TLS.","commonSituations":"An old portals.yml entry still uses http://; a URL was copied from a non-TLS mirror; the feed was migrated to HTTPS but a stale config wasn't updated.","solutions":["Change the scheme in the offending URL to https://.","Confirm the HTTPS endpoint actually serves the feed (curl https://larajobs.com/feed).","If you genuinely need HTTP (test fixture), point it at a local mock over HTTPS instead."],"exampleFix":"// before\napi: http://larajobs.com/feed\n\n// after\napi: https://larajobs.com/feed","handlingStrategy":"validation","validationCode":"import { URL } from 'node:url';\nexport function isHttpsUrl(value) {\n  try { return new URL(value).protocol === 'https:'; } catch { return false; }\n}\n// if (!isHttpsUrl(entry.api)) failConfig('larajobs api must be HTTPS');","typeGuard":"/** @param {string} url */\nfunction isHttps(url) {\n  try { return new URL(url).protocol === 'https:'; } catch { return false; }\n}","tryCatchPattern":"try {\n  assertLarajobsUrl(url);\n} catch (err) {\n  if (err.message.includes('HTTPS')) console.warn(`refusing non-HTTPS larajobs URL: ${url}`);\n  throw err;\n}","preventionTips":["Default all feed URLs to https:// in config templates and examples.","Add a config lint rule that rejects http:// for any larajobs entry.","Never construct larajobs URLs from user input without forcing the https scheme."],"tags":["url-validation","https","transport-security","larajobs"],"backgroundTag":null,"analyzedSha":"9b17a8ac97b398a496b38e423ae24e433b43254f","analyzedAt":"2026-08-13T00:48:39.135Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}