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 <noreply@anthropic.com>
This commit is contained in:
@@ -104,7 +104,7 @@ export async function fetchIsochrones(
|
|||||||
try {
|
try {
|
||||||
response = await fetch(`${VALHALLA_BASE}/isochrone`, {
|
response = await fetch(`${VALHALLA_BASE}/isochrone`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json', 'Connection': 'close' },
|
||||||
body,
|
body,
|
||||||
signal: abortController.signal
|
signal: abortController.signal
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user