{"record":{"id":"c7c1cf3c6a0c43e4","repo":"santifer/career-ops","slug":"yourator-url-must-use-https-url","errorCode":null,"errorMessage":"yourator: URL must use HTTPS: ${url}","messagePattern":"yourator: URL must use HTTPS: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"providers/yourator.mjs","lineNumber":83,"sourceCode":"\nconst SITE_ORIGIN = 'https://www.yourator.co';\nconst FEED_BASE = `${SITE_ORIGIN}/api/v4/jobs`;\nconst TRUSTED_HOST = 'www.yourator.co';\n// Safety bound only — the loop stops on payload.hasMore. The live board was 88\n// pages on 2026-08-18; this leaves room to grow without silently truncating.\nconst DEFAULT_MAX_PAGES = 120;\nconst MAX_PAGES_CAP = 500;\nconst PAGE_DELAY_MS = 200;\n\n/** @param {string} url */\nfunction assertYouratorUrl(url) {\n  let parsed;\n  try {\n    parsed = new URL(url);\n  } catch {\n    throw new Error(`yourator: invalid URL: ${url}`);\n  }\n  if (parsed.protocol !== 'https:') throw new Error(`yourator: URL must use HTTPS: ${url}`);\n  if (parsed.hostname !== TRUSTED_HOST) {\n    throw new Error(`yourator: untrusted hostname \"${parsed.hostname}\" — must be ${TRUSTED_HOST}`);\n  }\n  return url;\n}\n\n/** Resolve the page cap: a positive integer `max_pages` on the entry, capped. */\nfunction resolveMaxPages(entry) {\n  const v = entry?.max_pages;\n  if (Number.isInteger(v) && v > 0) return Math.min(v, MAX_PAGES_CAP);\n  return DEFAULT_MAX_PAGES;\n}\n\n/**\n * Canonical URL for a posting — Source Indexing Policy rule 2, \"the shortest\n * verifiable path to the employer the source exposes\".\n *\n * Prefers `thirdPartyUrl` (the employer's own ATS page), with the board's","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/providers/yourator.mjs#L65-L101","documentation":"assertYouratorUrl requires the parsed URL's protocol to be exactly https:. After a successful parse, any http: (or other scheme like ftp:, file:) URL throws this error. The provider enforces HTTPS to guarantee transport security for every request it issues against the Yourator API.","triggerScenarios":"A portals.yml entry or caller supplies an 'http://yourator.net/...' URL, or a scheme-less string that happened to parse (rare, e.g. 'https:yourator' variants) with a non-https protocol, or a custom scheme like file://.","commonSituations":"Old bookmarks or internal notes still pointing at http; hand-written config defaulting to http; redirect targets or user-supplied links downgraded to http; concatenation bugs producing 'httpss://' style typos.","solutions":["Change the configured URL to use https:// explicitly","If the value comes from user input or config, normalize http:// → https:// at load time","Keep the guard: do not weaken the check; use it as validation feedback to fix the source value","Check any code building URLs via string concatenation for scheme mistakes"],"exampleFix":"// before\nconst url = 'http://yourator.net/en/companies/acme';\n// after\nconst url = 'https://yourator.net/en/companies/acme';","handlingStrategy":"validation","validationCode":"const u = new URL(candidateUrl);\nif (u.protocol !== 'https:') {\n  throw new Error(`yourator URL must be https, got ${u.protocol}`);\n}","typeGuard":"function isHttpsUrl(s) {\n  try { return new URL(s).protocol === 'https:'; } catch { return false; }\n}","tryCatchPattern":"try {\n  await scanYourator(entry);\n} catch (e) {\n  if (e.message.startsWith('yourator: URL must use HTTPS')) {\n    console.warn('Upgrade the configured URL to https:// — plain http is rejected by design.');\n  } else throw e;\n}","preventionTips":["Always write https:// explicitly in portals.yml and documentation","Normalize legacy http:// values to https:// at config load time","Never accept HTTP downgrade for scraping endpoints","Note the guard exists for transport security — don't bypass it, fix the source"],"tags":["url","https","validation","yourator"],"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"}