Merge pull request 'fix: update docker-compose network to external and enhance avatar URL resolution logic' (#383) from fix/alembic-version into development

Reviewed-on: ADUANASOFT/anexo76#383
This commit is contained in:
2026-05-11 15:38:25 +00:00
4 changed files with 19 additions and 12 deletions

1
frontend/.gitignore vendored
View File

@@ -26,6 +26,7 @@ Thumbs.db
!.env.test
# Vite
.vite/
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

View File

@@ -14,7 +14,8 @@
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"format": "prettier --write .",
"lint": "prettier --check . && eslint .",
"test:unit": "vitest",
"test:unit": "vitest --project server",
"test:unit:full": "vitest",
"test": "npm run test:unit -- --run && npm run test:e2e",
"test:e2e": "playwright test"
},

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 {

View File

@@ -38,7 +38,7 @@ const vitestClientProject = {
export default defineConfig({
server: {
port: 5173, // fija el puerto
port: 5173, // fija el puerto
host: true, // escucha en 0.0.0.0
// Lista explícita + peticiones internas (p. ej. chunks JSON `?import`) pueden usar
// Hosts distintos y recibir 403. `true` permite cualquier Host en dev.