Agregue una URL JavaScript de Slash Trastring
// Add trailing slash even when a query is present.
// supported in all modern browsers
let url = new URL("a?foo=bar", "https://example.com");
if (url.pathname[url.pathname.length - 1] != "/") {
url.pathname += "/";
}
// https://example.com/a/?foo=bar
console.log(url.toString());
XenoBino