From 7319184f74586adbfbbf6675ecbf0e8024eb51d9 Mon Sep 17 00:00:00 2001 From: kerboul Date: Tue, 31 Mar 2026 15:55:15 +0200 Subject: [PATCH] fix: add Connection: close to prevent keep-alive socket reuse after abort When AbortController.abort() resets a TCP connection mid-request, Chromium may reuse the same keep-alive socket for the next request. Valhalla's HTTP server then returns ERR_EMPTY_RESPONSE. Forcing Connection: close ensures each request uses a fresh TCP connection. Co-Authored-By: Claude Sonnet 4.6 --- src/renderer/src/api/ors.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/src/api/ors.ts b/src/renderer/src/api/ors.ts index 1832d95..2ce1f86 100644 --- a/src/renderer/src/api/ors.ts +++ b/src/renderer/src/api/ors.ts @@ -104,7 +104,7 @@ export async function fetchIsochrones( try { response = await fetch(`${VALHALLA_BASE}/isochrone`, { method: 'POST', - headers: { 'Content-Type': 'application/json' }, + headers: { 'Content-Type': 'application/json', 'Connection': 'close' }, body, signal: abortController.signal })