From bb44b4e18e03a7ebf8de4ddb300623868361d9f2 Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Sat, 21 Feb 2026 23:16:09 +0000 Subject: [PATCH] [ci skip] Fix JS shim rw() routing non-proxy paths through proxy prefix When upstream JS constructs URLs via location.origin + '/path', the rw() function stripped the origin but returned bare '/path' which hit our server's HTML index. Now correctly prefixes with /proxy/{b64origin} so XHR/fetch requests for scripts reach the upstream via proxy. Bump image to v1.2.7 --- modules/kubernetes/f1-stream/files/internal/proxy/proxy.go | 4 ++-- modules/kubernetes/f1-stream/main.tf | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/kubernetes/f1-stream/files/internal/proxy/proxy.go b/modules/kubernetes/f1-stream/files/internal/proxy/proxy.go index 92ce5b9e..d3785e0d 100644 --- a/modules/kubernetes/f1-stream/files/internal/proxy/proxy.go +++ b/modules/kubernetes/f1-stream/files/internal/proxy/proxy.go @@ -58,8 +58,8 @@ function rw(u){ if(!u||typeof u!=='string')return u; if(u.startsWith('/proxy/'))return u; if(u.startsWith(H+'/proxy/'))return u.slice(H.length); -if(u.startsWith(H+'/'))return u.slice(H.length); -if(u.startsWith(H))return u.slice(H.length)||'/'; +if(u.startsWith(H+'/')){var hp=u.slice(H.length);return P+hp;} +if(u.startsWith(H))return P+'/'; if(u.startsWith('/'))return P+u; if(u.startsWith(O))return P+u.slice(O.length); try{var p=new URL(u);if(p.protocol==='http:'||p.protocol==='https:'){return'/proxy/'+b64(p.origin)+p.pathname+p.search+p.hash;}}catch(e){} diff --git a/modules/kubernetes/f1-stream/main.tf b/modules/kubernetes/f1-stream/main.tf index 5eeba860..455fe778 100644 --- a/modules/kubernetes/f1-stream/main.tf +++ b/modules/kubernetes/f1-stream/main.tf @@ -37,7 +37,7 @@ resource "kubernetes_deployment" "f1-stream" { } spec { container { - image = "viktorbarzin/f1-stream:v1.2.6" + image = "viktorbarzin/f1-stream:v1.2.7" name = "f1-stream" resources { limits = {