santifer/career-ops · error · Error

arbeitnow: URL must use HTTPS

Error message

arbeitnow: URL must use HTTPS: ${url}

What it means

After parsing, assertArbeitnowUrl requires the protocol to be exactly https:. Any http:, ftp:, or other scheme throws this error. It's part of the provider's SSRF/transport-security guard: job-board feeds must only be fetched over TLS.

Solutions

  1. Change the URL scheme to https:// — arbeitnow's API is served over TLS, so there's no reason to use http.
  2. If a local test needs http, stub ctx.fetchJson instead of feeding an http URL through the validator.
  3. Fix mistyped schemes (https:/, //host) — run the string through new URL() locally to confirm protocol === 'https:' before calling.
  4. Audit config/env for HTTP_URL-style overrides that downgrade the scheme.

Example fix

// before
const url = 'http://www.arbeitnow.com/api/job-board-api?page=1';
// after
const url = 'https://www.arbeitnow.com/api/job-board-api?page=1';
Defensive patterns

Strategy: validation

Validate before calling

const u = new URL(url);
if (u.protocol !== 'https:') throw new Error(`feed URLs must be https (got ${u.protocol})`);

Type guard

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

Try / catch

try {
  await provider.fetch(entry, ctx);
} catch (err) {
  if (String(err.message).includes('must use HTTPS')) {
    console.error('Config supplied a non-HTTPS feed URL — arbeitnow serves TLS; switch the scheme to https://');
  }
  throw err;
}

Prevention

When it happens

Trigger: A URL with scheme other than https reaches the validator — most commonly a plain-http feed URL ('http://www.arbeitnow.com/api/job-board-api'), an env/config override switching to http for local testing, or a protocol-relative or mistyped scheme (https:/, htps://).

Common situations: Local dev stubs served over http; copied documentation links that use http; config migrated from another provider that allowed http; a proxy setup that terminates TLS and rewrites URLs to http://.

Understand the failure class

Background: "Invalid URL" errors: why new URL(), URI.parse, and reqwest::Url reject your string — missing scheme, whitespace, and bad path format — this error's family across 39 libraries.

Related errors


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

Appendix: source

Thrown at providers/arbeitnow.mjs:32

// override with `max_pages` on the portal entry).
//
// Wire in via a `job_boards:` entry with `provider: arbeitnow`.

const FEED_BASE = 'https://www.arbeitnow.com/api/job-board-api';
const TRUSTED_HOST = 'www.arbeitnow.com';
const PER_PAGE = 100;
const DEFAULT_MAX_PAGES = 3;
const MAX_PAGES_CAP = 50;

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

/** Resolve the page cap: a positive integer `max_pages` on the entry, capped. */
function resolveMaxPages(entry) {
  const v = entry?.max_pages;
  if (Number.isInteger(v) && v > 0) return Math.min(v, MAX_PAGES_CAP);
  return DEFAULT_MAX_PAGES;
}

/**
 * Normalize a single Arbeitnow job. Exported for unit tests.
 *
 * Field mapping → the normalized Job shape:
 *   - title:    `title`, trimmed (items without one are dropped).

View on GitHub (pinned to aac998c7ed)