{"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":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"providers/larajobs.mjs","lineNumber":27,"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":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/providers/larajobs.mjs#L9-L45","documentation":"assertLarajobsUrl enforces HTTPS: a successfully parsed URL whose protocol is not 'https:' is rejected with this error. This keeps job-feed traffic off plaintext transports and prevents accidental downgrade to http.","triggerScenarios":"Passing any http:// (or other non-https scheme) larajobs URL to assertLarajobsUrl or the provider's fetch path, e.g. 'http://larajobs.com/api/jobs'.","commonSituations":"Legacy config entries using http://, a user editing portals.yml by hand and dropping the 's', or an internal mirror URL written with http.","solutions":["Change the scheme to https:// in the URL or config entry.","Grep the config for 'http://' and correct each occurrence.","Verify with new URL(u).protocol === 'https:' before invoking the provider.","If the endpoint lacks HTTPS support, remove the entry — the validator intentionally cannot be bypassed."],"exampleFix":"// before\nassertLarajobsUrl('http://larajobs.com/api/jobs');\n// after\nassertLarajobsUrl('https://larajobs.com/api/jobs');","handlingStrategy":"validation","validationCode":"function isHttpsUrl(u) { try { return new URL(u).protocol === 'https:'; } catch { return false; } }\nif (!isHttpsUrl(url)) throw new Error(`larajobs endpoint must be https: ${url}`);","typeGuard":"function isHttpsUrlString(v) { if (typeof v !== 'string') return false; try { return new URL(v).protocol === 'https:'; } catch { return false; } }","tryCatchPattern":"try {\n  provider.fetch(entry, ctx);\n} catch (e) {\n  if (e.message.startsWith('larajobs: URL must use HTTPS')) {\n    console.warn(`Upgrading to https: ${e.message}`);\n    return provider.fetch({ ...entry, url: entry.url.replace(/^http:/, 'https:') }, ctx);\n  }\n  throw e;\n}","preventionTips":["Use https:// everywhere in config and docs","CI-check portals.yml for http:// occurrences","Normalize http->https at config load time when the endpoint supports TLS","Never bypass TLS enforcement to make a broken endpoint work"],"tags":["url-validation","https","security"],"backgroundTag":"invalid-url","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"}