{"record":{"id":"6dfbfadfa0fbec74","repo":"santifer/career-ops","slug":"manfred-url-must-use-https-url","errorCode":null,"errorMessage":"manfred: URL must use HTTPS: ${url}","messagePattern":"manfred: URL must use HTTPS: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"providers/manfred.mjs","lineNumber":35,"sourceCode":"//      `\"lang must be one of the following values: EN, ES\"`.\n//\n// Wire in via a `job_boards:` entry with `provider: manfred`.\n\nconst FEED_BASE = 'https://www.getmanfred.com/api/v2/public/offers';\nconst TRUSTED_HOST = 'www.getmanfred.com';\nconst OFFER_BASE = 'https://www.getmanfred.com/ofertas-empleo';\nconst VALID_LANGS = ['EN', 'ES'];\nconst DEFAULT_LANG = 'EN';\n\n/** @param {string} url */\nfunction assertManfredUrl(url) {\n  let parsed;\n  try {\n    parsed = new URL(url);\n  } catch {\n    throw new Error(`manfred: invalid URL: ${url}`);\n  }\n  if (parsed.protocol !== 'https:') throw new Error(`manfred: URL must use HTTPS: ${url}`);\n  if (parsed.hostname !== TRUSTED_HOST) {\n    throw new Error(`manfred: untrusted hostname \"${parsed.hostname}\" — must be ${TRUSTED_HOST}`);\n  }\n  return url;\n}\n\n/** Resolve the feed language: `lang` on the entry, uppercased, else EN. */\nexport function resolveLang(entry) {\n  const raw = typeof entry?.lang === 'string' ? entry.lang.trim().toUpperCase() : '';\n  return VALID_LANGS.includes(raw) ? raw : DEFAULT_LANG;\n}\n\n// The feed reports currency as the SYMBOL, not an ISO code, and the observed\n// values include a narrow-no-break-space variant of the euro sign. scan.mjs's\n// salary_filter compares currencies case-insensitively as plain strings, so a\n// symbol would never match a user's `currency: EUR` — map to ISO, and drop the\n// field entirely rather than guess when the symbol is unknown.\nconst CURRENCY_BY_SYMBOL = new Map([","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/santifer/career-ops/blob/9b17a8ac97b398a496b38e423ae24e433b43254f/providers/manfred.mjs#L17-L53","documentation":"Second guard in assertManfredUrl: after a successful parse, parsed.protocol must be 'https:'. Any other scheme is rejected to enforce TLS on the Manfred API call.","triggerScenarios":"The URL parses but uses http://, ftp://, file://, or another non-https scheme. Most often a plain-http URL was constructed or configured.","commonSituations":"A legacy/test URL over HTTP; a feed base copied without the scheme; a derived offer URL lost its scheme during string building.","solutions":["Ensure the URL starts with https:// (Manfred's API is HTTPS-only).","Verify with curl https://www.getmanfred.com/api/v2/public/offers.","Fix any URL builder that omits or downgrades the scheme."],"exampleFix":"// before\nfeedUrl = 'http://www.getmanfred.com/api/v2/public/offers'\n\n// after\nfeedUrl = 'https://www.getmanfred.com/api/v2/public/offers'","handlingStrategy":"validation","validationCode":"import { URL } from 'node:url';\nexport function isHttpsUrl(value) {\n  try { return new URL(value).protocol === 'https:'; } catch { return false; }\n}","typeGuard":"/** @param {string} url */\nfunction isHttps(url) {\n  try { return new URL(url).protocol === 'https:'; } catch { return false; }\n}","tryCatchPattern":"try {\n  assertManfredUrl(url);\n} catch (err) {\n  if (err.message.includes('HTTPS')) console.warn(`refusing non-HTTPS manfred URL: ${url}`);\n  throw err;\n}","preventionTips":["Always construct manfred URLs over https://.","Never override the protocol check; downgrade it only behind an explicit, reviewed change.","CI-lint config to reject http:// on manfred entries."],"tags":["url-validation","https","transport-security","manfred"],"backgroundTag":null,"analyzedSha":"9b17a8ac97b398a496b38e423ae24e433b43254f","analyzedAt":"2026-08-13T00:48:39.135Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}