This commit is contained in:
biglyderv 2025-02-01 13:40:51 -05:00
parent 8e822aba75
commit 6a6bfab5f6

11
site.js
View file

@ -43,11 +43,20 @@ async function urlCollector(url, path, file, useLimit, data2) {
let h = body(link).attr('href');
if (!h) return true;
h = h.trim();
if (h.startsWith('./') || h.startsWith('../') || h.startsWith('/')) {
if (h.startsWith('./') || h.startsWith('../') || h.startsWith('/')) {
let u = new URL(url);
u.pathname = h;
h = u.toString();
}
if (h.startsWith('?')) {
let u = new URL(url);
u.search = h;
h = u.toString();
}
if (h.startsWith('#')) {
let u = new URL(url);
h = u.toString();
}
let h2;
try {
h2 = new URL(h);