fix: update docker-compose network to external and enhance avatar URL resolution logic
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user