We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f9f636 commit 5884845Copy full SHA for 5884845
src/api/Api.js
@@ -275,7 +275,13 @@ export class Api {
275
Object.seal(response)
276
277
for (const callback of callbacks) {
278
- await callback(response)
+ // note: this does not quite work as the response body
279
+ // cannot be modified or even read twice.
280
+ // the current solution of cloning the response
281
+ // to every callback, may incur performance
282
+ // pressure as typical callbacks likely want to examine the
283
+ // request body and would repeatedly parse the json bodies
284
+ await callback(response.clone())
285
}
286
287
return response
0 commit comments