mirror of
https://github.com/by-sonic/tglock.git
synced 2026-11-05 23:31:58 +03:00
fix(worker): name the published script version in the browser check (#72)
The dashboard editor shows a saved draft while requests are served by the last deployed version. A user with the new text in the editor was running the pre-beta.15 script, which writes Blob frames into the socket on current compatibility dates (Cloudflare warns "This TransformStream is being used as a byte stream ...") and drops every tunnel (#53). Reproduced on local workerd: the old script logs exactly that warning, the current one does not. GET /apiws now answers "TGLock Worker <version>" and X-TGLock-Worker, and the docs say a missing line means an old script is still deployed. Co-authored-by: babin <Thartewerner536e@engineer.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -77,7 +77,11 @@ async function fixture({ opened = Promise.resolve(), write, timeout = false } =
|
||||
|
||||
test("HTTP deployment check does not claim Telegram connectivity", async () => {
|
||||
const f = await fixture();
|
||||
assert.equal((await f.fetch("/apiws", { Upgrade: "" })).status, 426);
|
||||
const check = await f.fetch("/apiws", { Upgrade: "" });
|
||||
assert.equal(check.status, 426);
|
||||
// The browser check names the published version (#53).
|
||||
assert.match(check.body, /^expected a websocket upgrade\nTGLock Worker \d{4}-\d{2}-\d{2}\n$/);
|
||||
assert.match(check.headers["X-TGLock-Worker"], /^\d{4}-\d{2}-\d{2}$/);
|
||||
assert.equal(f.state.connects, 0);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user