Checks send no Referer header, so Hetzner answers (closes #191)
check / check (push) Waiting to run

The Hetzner speed-test servers close the connection without an answer
when the request has a Referer header. The browser sends one unless the
page comes with the image's Referrer-Policy: no-referrer header, which a
static host and make dev do not send. Each check now sets
referrerPolicy: "no-referrer".

Model: opus-5-5
This commit is contained in:
2026-10-26 00:14:38 +00:00
parent db5eb507c1
commit 8f63fef3b1
4 changed files with 29 additions and 8 deletions
+11
View File
@@ -180,6 +180,17 @@ test("a check fetches the target's URL as written, with no query string added",
);
});
test("a check sends no Referer header, wherever the page is served from", async (t) => {
mockTargets(t, () => 10);
const check = measureLatency("https://fsn1-speed.hetzner.com");
t.mock.timers.tick(10);
assert.notEqual(await settled(check), "still waiting");
assert.equal(
fetch.mock.calls[0].arguments[1].referrerPolicy,
"no-referrer",
);
});
test("at a 30000ms interval, a target answering after 1000ms shows in its row while another target's check is still waiting", async (t) => {
CONFIG.updateInterval = 30000;
const state = new AppState([