diff --git a/servicios/nexxa/organismo/VERSION b/servicios/nexxa/organismo/VERSION index 347f5833..9df886c4 100644 --- a/servicios/nexxa/organismo/VERSION +++ b/servicios/nexxa/organismo/VERSION @@ -1 +1 @@ -1.4.1 +1.4.2 diff --git a/servicios/nexxa/organismo/server.rb b/servicios/nexxa/organismo/server.rb index 73fa156f..7e617e45 100644 --- a/servicios/nexxa/organismo/server.rb +++ b/servicios/nexxa/organismo/server.rb @@ -143,7 +143,8 @@ LOGIN_FILE = File.expand_path('login.html', WEB_DIR).freeze # agrega ?v= a cada /js/ y /css/: cada versión nueva obliga a bajar los archivos nuevos. El HTML en sí no se # cachea (no-cache), así siempre trae la versión vigente. def html_con_version(ruta) - File.read(ruta).gsub(%r{(["'])(/(?:js|css)/[^"'?]+\.(?:js|css))\1}) { "#{$1}#{$2}?v=#{version_actual}#{$1}" } + # encoding explícito: systemd corre con locale C (US-ASCII) y el gsub sobre un HTML con acentos daba 500 (1.4.1) + File.read(ruta, encoding: 'UTF-8').gsub(%r{(["'])(/(?:js|css)/[^"'?]+\.(?:js|css))\1}) { "#{$1}#{$2}?v=#{version_actual}#{$1}" } end server.mount_proc '/' do |req, res| diff --git a/servicios/nexxa/test/lib_servidor_prueba.rb b/servicios/nexxa/test/lib_servidor_prueba.rb index d807ab07..84a54950 100644 --- a/servicios/nexxa/test/lib_servidor_prueba.rb +++ b/servicios/nexxa/test/lib_servidor_prueba.rb @@ -37,7 +37,8 @@ module ServidorPrueba # Arranca server.rb de la copia y espera el puerto. => pid def arrancar(prueba, log: File.join(prueba[:dir], 'server.log')) - pid = Process.spawn('ruby', 'server.rb', chdir: prueba[:org], out: File::NULL, err: log) + # Locale C como systemd en el nodo: un File.read sin encoding explícito falla acá igual que en producción (1.4.1) + pid = Process.spawn({ 'LC_ALL' => 'C', 'LANG' => 'C' }, 'ruby', 'server.rb', chdir: prueba[:org], out: File::NULL, err: log) 60.times { abierto?(prueba[:puerto]) ? break : sleep(0.25) } raise "El server de prueba no abrió el puerto #{prueba[:puerto]} (ver #{log})" unless abierto?(prueba[:puerto])