Skip to content

Commit

Permalink
fix: also trigger postbody function on non esi responses
Browse files Browse the repository at this point in the history
  • Loading branch information
cdloh committed Sep 27, 2024
1 parent 0c9d7dc commit 7ff3313
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ export class esi {
const resp = new Response(response.body, response);
// We set the URL manually here as it doesn't come across from the copy˛
Object.defineProperty(resp, "url", { value: response.url });
// process postBody function if relevant
if (this.postBodyFunction) {
this.postBodyFunction();
}
return resp;
}

Expand Down

0 comments on commit 7ff3313

Please sign in to comment.