web / lib/utils/url-sanitize
lib/utils/url-sanitize
URL sanitization utilities for safe logging.
Strips query parameters (which may contain API keys, tokens, or other secrets) before URLs are written to log output.
Functions
sanitizeUrlForLogging()
sanitizeUrlForLogging(
url):string
Remove query string and fragment from a URL for safe logging.
Returns the scheme + host + path only. If the URL cannot be parsed, returns a placeholder so callers never accidentally log the raw value.
Parameters
url
string
Returns
string
Last updated on