Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp
294 B
Raw Blame
export function formatUrlForDiagnostics(value: string | URL): string {
	const url = typeof value === 'string' ? URL.parse(value) : value;
	if (!url) {
		return '[invalid URL]';
	}
	if (url.protocol !== 'http:' && url.protocol !== 'https:') {
		return '[non-HTTP URL]';
	}
	return url.origin;
}