[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
This commit is contained in:
Viktor Barzin 2026-02-21 23:16:09 +00:00
parent fab25e68ad
commit bb44b4e18e
No known key found for this signature in database
GPG key ID: 0EB088298288D958
2 changed files with 3 additions and 3 deletions

View file

@ -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){}

View file

@ -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 = {