export function assertAllowedReleaseUrl(raw: string, expectedHost: string): URL {
  const url = new URL(raw);
  if (
    url.protocol !== "https:"
    || url.hostname.toLowerCase() !== expectedHost.toLowerCase()
    || (url.port !== "" && url.port !== "443")
    || url.username !== ""
    || url.password !== ""
  ) {
    throw new Error(`URL de téléchargement non autorisée: ${url.origin}`);
  }
  return url;
}
