Merge branch 'development' of https://git.aduanasoft.com/ADUANASOFT/anexo76 into fix/trailers

This commit is contained in:
2026-05-11 12:03:16 -05:00
4 changed files with 19 additions and 12 deletions

View File

@@ -43,18 +43,23 @@ function parseAbsoluteLikeUrl(value: string): URL | null {
if (!trimmed) return null;
try {
return new URL(trimmed);
} catch {
// Soporta formato host:puerto/ruta sin protocolo.
if (/^[a-z0-9.-]+:\d+\//i.test(trimmed)) {
try {
return new URL(`http://${trimmed}`);
} catch {
return null;
}
const parsed = new URL(trimmed);
if (parsed.protocol === 'http:' || parsed.protocol === 'https:') {
return parsed;
}
return null;
} catch {
}
// Soporta formato host:puerto/ruta sin protocolo.
if (/^[a-z0-9.-]+:\d+\//i.test(trimmed)) {
try {
return new URL(`http://${trimmed}`);
} catch {
return null;
}
}
return null;
}
function rewriteInternalHostToPublicUrl(value: string): string {