santifer/career-ops · error · Error

weworkremotely: URL must use HTTPS: ${url}

Error message

weworkremotely: URL must use HTTPS: ${url}

What it means

SSRF guard branch: the URL parsed but its protocol is not https:. Guarantees the feed is never fetched over plain HTTP, where it could be transparently intercepted. As with the other weworkremotely URL guards, this only fires against the FEED_URL constant.

Source

Thrown at providers/weworkremotely.mjs:22

// We Work Remotely provider - board-wide RSS feed
// (https://weworkremotely.com/remote-jobs.rss). 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: weworkremotely`.

const FEED_URL = 'https://weworkremotely.com/remote-jobs.rss';
const TRUSTED_HOST = 'weworkremotely.com';

/** @param {string} url */
function assertWwrUrl(url) {
  let parsed;
  try {
    parsed = new URL(url);
  } catch {
    throw new Error(`weworkremotely: invalid URL: ${url}`);
  }
  if (parsed.protocol !== 'https:') throw new Error(`weworkremotely: URL must use HTTPS: ${url}`);
  if (parsed.hostname !== TRUSTED_HOST) {
    throw new Error(`weworkremotely: 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() : 'We Work Remotely';
}

/** @type {Provider} */

View on GitHub (pinned to 9b17a8ac97)

Solutions

  1. Set FEED_URL back to its https form.
  2. Never bypass the protocol check — it is load-bearing for SSRF safety.

Example fix

// before
const FEED_URL = 'http://weworkremotely.com/remote-jobs.rss';
// after
const FEED_URL = 'https://weworkremotely.com/remote-jobs.rss';
Defensive patterns

Strategy: validation

Validate before calling

const u = new URL(FEED_URL);
if (u.protocol !== "https:") throw new Error("weworkremotely: FEED_URL must be https");

Type guard

const isHttps = (s) => { try { return new URL(s).protocol === "https:"; } catch { return false; } };

Prevention

When it happens

Trigger: Reached with the FEED_URL constant; fires if a maintainer sets it to an http:// URL.

Common situations: Someone downgraded the constant to http during local debugging and forgot to revert; a bad merge.

Related errors


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