maskUrlCredentials

Masks username and password in every URL in a string, replacing them with *****.

For example, the credentials in "https://user:pass@host.com" become *****:*****, and in a log line holding several URLs each one is masked. Only an @ inside an authority (between :// and the first /, ?, # or whitespace) separates credentials, so an @ in the path, query, or fragment is left alone. Credentials must be percent-encoded as RFC 3986 requires: an unencoded /, ?, # or space in a password ends the authority early.

Return

the string with masked credentials, or the original string if no credentials are present