santifer/career-ops · error · Error

senjob: URL must use HTTPS

Error message

senjob: URL must use HTTPS: ${url}

What it means

URL scheme guard in the Senjob provider (assertSenjobUrl): the parsed URL's protocol is not https:. The URL is well-formed and presumably passes the host checks, but the provider refuses non-HTTPS fetches. The input at fault is the board/scrape URL passed to the provider.

Solutions

  1. Change the URL to https:// in the provider entry or config.
  2. Fix URL-building code to always emit https.
  3. For local HTTP test servers, mock at the fetch layer rather than passing an http:// URL.

Example fix

// before
url = 'http://www.senjob.de/jobs';
// after
url = 'https://www.senjob.de/jobs';
Defensive patterns

Strategy: validation

Validate before calling

const isHttps = (u) => { try { return new URL(u).protocol === 'https:'; } catch { return false; } };
if (!isHttps(entry.url)) entry.url = entry.url.replace(/^http:/, 'https:');

Type guard

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

Try / catch

try { await provider.fetch(entry, ctx); } catch (e) { if (e.message.includes('must use HTTPS')) { console.warn(`Upgrade ${entry.url} to https://`); return null; } throw e; }

Prevention

When it happens

Trigger: Providing a senjob URL with protocol http: (or file:/ftp:) — commonly an http://www.senjob.de entry in config or a URL built without forcing the scheme.

Common situations: Legacy bookmarks/config predating the site's HTTPS migration, local http mocks, or hand-written entries using 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/90e7761867c2327e. Report an issue: GitHub.

Appendix: source

Thrown at providers/senjob.mjs:79

/** The machine-readable publication date, hidden next to its localized form. */
const HIDDEN_ISO_DATE_RE = /display:\s*none;?\s*"?>\s*(\d{4}-\d{2}-\d{2})\s*</i;

/** @param {any} ctx @param {number} ms */
function sleep(ctx, ms) {
  if (typeof ctx?.sleep === 'function') return ctx.sleep(ms);
  return new Promise((r) => setTimeout(r, ms));
}

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

/**
 * Collapse a markup fragment to its visible text.
 * Comments are stripped FIRST: the anchor bodies carry `<!-- d ico postulez -->`
 * between the title and a spacer image, and a naive tag strip would leave the
 * comment body sitting inside the title.
 * @param {string} fragment
 * @returns {string}
 */
export function visibleText(fragment) {
  return decodeEntities(
    String(fragment ?? '')
      .replace(/<!--[\s\S]*?-->/g, ' ')

View on GitHub (pinned to aac998c7ed)