santifer/career-ops · error · Error

agentic-jobs: URL must use HTTPS

Error message

agentic-jobs: URL must use HTTPS: ${url}

What it means

assertAgenticUrl in providers/agentic-jobs.mjs throws this when the URL parses but its protocol is not 'https:'. The agentic-jobs provider refuses to fetch over plaintext, so any http:// (or other non-HTTPS scheme) URL is rejected before the hostname check runs. Only valid HTTPS URLs proceed to the TRUSTED_HOST comparison.

Solutions

  1. Change the scheme to https:// and retry.
  2. If the target host has no HTTPS, it is unsupported — use the provider's official HTTPS feed endpoint.
  3. Enable TLS on the feed server if you control it, then update the config.
  4. Grep your config for hardcoded http:// schemes and normalize them.

Example fix

// before
fetchAgenticJobs('http://agenticjobs.dev/api')
// after
fetchAgenticJobs('https://agenticjobs.dev/api')
Defensive patterns

Strategy: validation

Validate before calling

const u = new URL(rawUrl);
if (u.protocol !== 'https:') throw new Error(`agentic-jobs feed URL must use https, got ${u.protocol}`);

Type guard

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

Try / catch

try {
  await fetchAgenticJobs(url);
} catch (e) {
  if (String(e.message).includes('URL must use HTTPS')) {
    const fixed = url.replace(/^http:/, 'https:');
    console.warn(`Upgrading ${url} -> ${fixed}`);
    return fetchAgenticJobs(fixed);
  } else throw e;
}

Prevention

When it happens

Trigger: Passing an 'http://...' URL (or ftp:/file: etc.) to the provider — typically a config default or legacy feed link that was never upgraded to HTTPS.

Common situations: Old bookmarks/config using http://; local development servers over plain HTTP being tested against the provider; YAML config written without the scheme and another layer prepending 'http://'.

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/03e704daa72434f4. Report an issue: GitHub.

Appendix: source

Thrown at providers/agentic-jobs.mjs:47

// Wire in via a `job_boards:` entry with `provider: agentic-jobs`.

const SITE_ORIGIN = 'https://agentic-engineering-jobs.com';
const API_BASE = `${SITE_ORIGIN}/api/v1`;
const TRUSTED_HOST = 'agentic-engineering-jobs.com';
const PAGE_SIZE = 50; // fixed by the API (meta.per_page)
const MAX_PAGES = 40; // safety cap on request count (40*50 = 2000 postings)
const MAX_JOBS = 2000;
const PAGE_DELAY_MS = 2100; // stays under the documented 30 req/60s limit

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

const regionNames = new Intl.DisplayNames(['en'], { type: 'region' });

/**
 * Resolve a two-letter ISO country code to an English name. Returns '' for
 * anything that isn't a resolvable two-letter code. Exported for tests.
 * @param {unknown} code
 */
export function countryName(code) {
  if (typeof code !== 'string' || !/^[A-Za-z]{2}$/.test(code)) return '';
  try {
    const name = regionNames.of(code.toUpperCase());
    return name && name !== code.toUpperCase() ? name : '';

View on GitHub (pinned to aac998c7ed)