Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

485 B
Raw Blame
/**
 * A connection URL fit for a log line: the password masked and the query
 * dropped, since libpq reads a password from the query too
 * (`?password=...`). A value that does not parse is not echoed at all.
 */
export function redactUrl(url: string): string {
  let parsed: URL;
  try {
    parsed = new URL(url);
  } catch {
    return '<unparseable URL>';
  }
  if (parsed.password) parsed.password = '***';
  parsed.search = '';
  parsed.hash = '';
  return parsed.toString();
}