santifer/career-ops · error · Error

themuse: URL must use HTTPS: ${url}

Error message

themuse: URL must use HTTPS: ${url}

What it means

assertMuseUrl's second check rejects any protocol other than 'https:'. As with the other themuse guards, it validates the hardcoded FEED_BASE, so it fires only if FEED_BASE was changed to an http:// (or other-scheme) value. The provider is HTTPS-only by policy.

Source

Thrown at providers/themuse.mjs:22

// The Muse provider — public, zero-auth JSON jobs feed.
// Endpoint: https://www.themuse.com/api/public/jobs?page={n}
// Response shape: { results: [...], page: n, page_count: N }
// All pages are fetched sequentially and aggregated before normalizing.
//
// Wire in via a `job_boards:` entry with `provider: themuse`.

const FEED_BASE = 'https://www.themuse.com/api/public/jobs';
const TRUSTED_HOST = 'www.themuse.com';

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

/**
 * Normalize a single result from the Muse API response. Exported for unit tests.
 *
 * Field mapping:
 *   name              → title
 *   refs.landing_page → url
 *   company.name      → company
 *   locations[0].name → location
 *
 * Returns null when required fields (title or url) are missing or invalid.
 *
 * @param {any} j

View on GitHub (pinned to 9b17a8ac97)

Solutions

  1. Restore FEED_BASE to its https://www.themuse.com/... default
  2. Ensure any retargeted feed host is served over https
Defensive patterns

Strategy: validation

Validate before calling

try { if (new URL(FEED_BASE).protocol !== 'https:') throw 0; } catch { throw new Error('themuse: FEED_BASE must be an https URL'); }

Prevention

When it happens

Trigger: FEED_BASE was edited to an http:// URL, or assertMuseUrl is called from a fork/test with a non-https URL.

Common situations: Fork retargeting the feed to a non-https mirror; a test exercising the guard with http input.

Related errors


AI-assisted analysis of santifer/career-ops@9b17a8ac97 (2026-08-13). Data as JSON: /api/errors/640c2df6fb58eabf. Report an issue: GitHub.