fix(overlay): overlay windows read from the server that served them, no 'Server disconnected' over OBS on localhost (1.89.24)

This commit is contained in:
larssand committed 2026-11-14 13:46:08 +01:00
1 parent d74d8cf38f
commit 259945799d
6 files changed
+26 -5

No files matched your search

+7
View File
@@ -13,3 +13,10 @@ test("a phone on the laptop's IP ignores the laptop's saved localhost address",
assert.equal(resolveBackendUrl("", phone), "http://192.168.1.46:8081");
assert.equal(resolveBackendUrl("", { protocol: "file:" }), "http://127.0.0.1:8081");
});
test("an overlay window always reads from the server that served it", () => {
const obsOnLaptop = { protocol: "http:", hostname: "127.0.0.1", origin: "http://127.0.0.1:8081" };
assert.equal(resolveBackendUrl("http://192.168.1.46:8081", obsOnLaptop, { sameOrigin: true }), "http://127.0.0.1:8081");
assert.equal(resolveBackendUrl("http://192.168.1.46:8081", obsOnLaptop), "http://192.168.1.46:8081", "the admin page keeps the saved address");
assert.equal(resolveBackendUrl("http://192.168.1.46:8081", { protocol: "file:" }, { sameOrigin: true }), "http://192.168.1.46:8081", "not served over http: saved address");
});