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:
1
frontend/.gitignore
vendored
1
frontend/.gitignore
vendored
@@ -26,6 +26,7 @@ Thumbs.db
|
||||
!.env.test
|
||||
|
||||
# Vite
|
||||
.vite/
|
||||
vite.config.js.timestamp-*
|
||||
vite.config.ts.timestamp-*
|
||||
|
||||
|
||||
@@ -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"
|
||||
},
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user