santifer/career-ops · error · Error

nodesk: URL must use HTTPS

Error message

nodesk: URL must use HTTPS: ${url}

What it means

assertNodeskUrl enforces HTTPS on every URL it accepts. Once the string parses as a URL, this error is thrown if parsed.protocol is anything other than 'https:' — typically a plain-http URL. The provider only talks to the trusted host over TLS, so http:// links are rejected outright.

Solutions

  1. Change the scheme in the config/source to https://
  2. If the source is an env var or CLI flag, update the value passed in to use https
  3. If you control the upstream link, replace stored http:// links with their https equivalents
  4. Do not disable the check — the host requirement exists to keep API traffic encrypted and pinned to the trusted host

Example fix

// before
{ careers_url: 'http://nodesk.example/api/postings' }
// after
{ careers_url: 'https://nodesk.example/api/postings' }
Defensive patterns

Strategy: validation

Validate before calling

const parsed = new URL(url);
if (parsed.protocol !== 'https:') throw new Error(`use https: ${url}`);

Type guard

function isHttpsUrl(u) {
  try { return new URL(u).protocol === 'https:'; } catch { return false; }
}

Try / catch

try {
  useNodesk(url);
} catch (e) {
  if (String(e.message).startsWith('nodesk: URL must use HTTPS')) {
    log.warn(`Upgrading to https: ${url}`);
    return useNodesk(url.replace(/^http:/, 'https:'));
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling the nodesk provider (or assertNodeskUrl) with a URL whose scheme is 'http:' or any non-https scheme such as 'ftp:' — e.g. 'http://<trusted-host>/api/jobs'.

Common situations: A config file or portal entry written with http:// by habit; an older bookmarked/internal link that predates HTTPS enforcement; a URL copied from a redirect chain that starts with http; mixed-scheme concatenation like 'http://' + host.

Understand the failure class

Background: "Invalid URL" / "URL cannot be empty": fix the malformed or missing URL behind request-construction failures — this error's family across 50 libraries.

Related errors


AI-assisted analysis of santifer/career-ops@aac998c7ed (2026-09-16). Data as JSON: /api/errors/8bd4bb1541595fa0. Report an issue: GitHub.

Appendix: source

Thrown at providers/nodesk.mjs:23

// NoDesk provider - board-wide RSS feed
// (https://nodesk.co/remote-jobs/index.xml). The feed is public, no-auth,
// and XML, so it is parsed in-process with the same tiny tag extractor
// approach as providers/personio.mjs rather than adding an XML dependency.
//
// Wire in via a `job_boards:` entry with `provider: nodesk`.

const FEED_URL = 'https://nodesk.co/remote-jobs/index.xml';
const TRUSTED_HOST = 'nodesk.co';

/** @param {string} url */
function assertNodeskUrl(url) {
  let parsed;
  try {
    parsed = new URL(url);
  } catch {
    throw new Error(`nodesk: invalid URL: ${url}`);
  }
  if (parsed.protocol !== 'https:') throw new Error(`nodesk: URL must use HTTPS: ${url}`);
  if (parsed.hostname !== TRUSTED_HOST) {
    throw new Error(`nodesk: untrusted hostname "${parsed.hostname}" - must be ${TRUSTED_HOST}`);
  }
  return url;
}

// NaN-safe Date.parse - `|| undefined` would also coerce a valid epoch 0.
function toEpochMs(value) {
  if (!value) return undefined;
  const parsed = Date.parse(value);
  return Number.isNaN(parsed) ? undefined : parsed;
}

function fallbackCompany(entry) {
  return typeof entry?.name === 'string' && entry.name.trim() ? entry.name.trim() : 'NoDesk';
}

/** @type {Provider} */

View on GitHub (pinned to aac998c7ed)