Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions worker/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ export function loadWorkerEnv(
"SERVER_INTERNAL_URL is not set, so this worker does not know where to hand a routine run.",
);
}
try {
const parsed = new URL(serverInternalUrl);
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
throw new Error("not http(s)");
}
} catch {
throw new Error(
"SERVER_INTERNAL_URL must be a valid http(s) URL, so this worker knows where to hand a routine run.",
);
}

const databaseUrl = environment.DATABASE_URL?.trim();
if (!databaseUrl) {
Expand Down