UNPKG

got

Version:

Human-friendly and powerful HTTP request library for Node.js

10 lines (9 loc) 248 B
/* Returns the URL as a string with `username` and `password` stripped. */ export default function stripUrlAuth(url) { const sanitized = new URL(url); sanitized.username = ''; sanitized.password = ''; return sanitized.toString(); }