Skip to content

Commit b1fb5e8

Browse files
committed
fix: remove unnecessary response clone
1 parent ecc05df commit b1fb5e8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/client/src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,6 @@ export class DefaultDelegatedRoutingV1HttpApiClient implements DelegatedRoutingV
429429

430430
this.inFlightRequests.set(key, requestPromise)
431431
const response = await requestPromise
432-
return response.clone()
432+
return response
433433
}
434434
}

packages/client/test/index.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,8 @@ describe('delegated-routing-v1-http-api-client', () => {
379379
// First request should hit the server
380380
await all(clientWithShortTTL.getProviders(cid))
381381

382-
// Second request should use cache
382+
// Second and third request should use cache
383+
await all(clientWithShortTTL.getProviders(cid))
383384
await all(clientWithShortTTL.getProviders(cid))
384385

385386
let callCount = parseInt(await (await fetch(`${process.env.ECHO_SERVER}/get-call-count`)).text(), 10)

0 commit comments

Comments
 (0)