{"record":{"id":"0ed4d61a87d55a0d","repo":"santifer/career-ops","slug":"weworkremotely-url-must-use-https-url","errorCode":null,"errorMessage":"weworkremotely: URL must use HTTPS: ${url}","messagePattern":"weworkremotely: URL must use HTTPS: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"providers/weworkremotely.mjs","lineNumber":23,"sourceCode":"// We Work Remotely provider - board-wide RSS feed\n// (https://weworkremotely.com/remote-jobs.rss). The feed is public, no-auth,\n// and XML, so it is parsed in-process with the same tiny tag extractor approach\n// as providers/personio.mjs rather than adding an XML dependency.\n//\n// Wire in via a `job_boards:` entry with `provider: weworkremotely`.\n\nconst FEED_URL = 'https://weworkremotely.com/remote-jobs.rss';\nconst TRUSTED_HOST = 'weworkremotely.com';\n\n/** @param {string} url */\nfunction assertWwrUrl(url) {\n  let parsed;\n  try {\n    parsed = new URL(url);\n  } catch {\n    throw new Error(`weworkremotely: invalid URL: ${url}`);\n  }\n  if (parsed.protocol !== 'https:') throw new Error(`weworkremotely: URL must use HTTPS: ${url}`);\n  if (parsed.hostname !== TRUSTED_HOST) {\n    throw new Error(`weworkremotely: 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() : 'We Work Remotely';\n}\n\n/** @type {Provider} */","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/providers/weworkremotely.mjs#L5-L41","documentation":"The weworkremotely provider only talks to the public HTTPS RSS feed at weworkremotely.com. After the URL parses, assertWwrUrl requires parsed.protocol to be exactly 'https:'; any other scheme (typically http:) is rejected with this error. This guarantees TLS for feed fetches and blocks insecure downgrades of a misconfigured URL.","triggerScenarios":"A portals.yml job_boards entry or caller supplies 'http://weworkremotely.com/remote-jobs.rss' (or any non-https scheme). The URL parses cleanly, so the invalid-URL branch is passed; only the protocol check throws.","commonSituations":"Typing the feed URL from memory and omitting the 's', following an http redirect link found on an old page, config generators that default to http://, copy-paste from a browser address bar after a downgrade.","solutions":["Change the scheme to https:// in the configured URL","Prefer the provider's built-in FEED_URL (https://weworkremotely.com/remote-jobs.rss) instead of overriding the URL in config","Add a pre-check in tooling that writes portals.yml: new URL(u).protocol === 'https:'"],"exampleFix":"// before\ncareers_url: http://weworkremotely.com/remote-jobs.rss\n// after\ncareers_url: https://weworkremotely.com/remote-jobs.rss","handlingStrategy":"validation","validationCode":"const isHttps = (url) => { try { return new URL(url).protocol === 'https:'; } catch { return false; } };\n// pre-check: isHttps(entry.careers_url)","typeGuard":"const isHttpsUrl = (u) => { try { return new URL(u).protocol === 'https:'; } catch { return false; } };","tryCatchPattern":"try {\n  await wwrProvider.fetch(entry, ctx);\n} catch (err) {\n  if (err.message.startsWith('weworkremotely: URL must use HTTPS')) {\n    console.error(`${entry.name}: switch the feed URL to https:// — ${err.message}`);\n    return;\n  }\n  throw err;\n}","preventionTips":["Store only https:// URLs in portals.yml; audit existing entries with a one-line script","Use the provider's built-in FEED_URL instead of custom careers_url values","Add a config-load lint that rejects non-https URLs for all providers"],"tags":["url-validation","https","security","config"],"backgroundTag":"invalid-url-format","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"}