[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:
parent
fab25e68ad
commit
bb44b4e18e
2 changed files with 3 additions and 3 deletions
|
|
@ -58,8 +58,8 @@ function rw(u){
|
||||||
if(!u||typeof u!=='string')return u;
|
if(!u||typeof u!=='string')return u;
|
||||||
if(u.startsWith('/proxy/'))return u;
|
if(u.startsWith('/proxy/'))return u;
|
||||||
if(u.startsWith(H+'/proxy/'))return u.slice(H.length);
|
if(u.startsWith(H+'/proxy/'))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 u.slice(H.length)||'/';
|
if(u.startsWith(H))return P+'/';
|
||||||
if(u.startsWith('/'))return P+u;
|
if(u.startsWith('/'))return P+u;
|
||||||
if(u.startsWith(O))return P+u.slice(O.length);
|
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){}
|
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){}
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ resource "kubernetes_deployment" "f1-stream" {
|
||||||
}
|
}
|
||||||
spec {
|
spec {
|
||||||
container {
|
container {
|
||||||
image = "viktorbarzin/f1-stream:v1.2.6"
|
image = "viktorbarzin/f1-stream:v1.2.7"
|
||||||
name = "f1-stream"
|
name = "f1-stream"
|
||||||
resources {
|
resources {
|
||||||
limits = {
|
limits = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue