Skip to content

Commit

Permalink
make sure to clone responses when running resource plugin serve block…
Browse files Browse the repository at this point in the history
… in dev server
  • Loading branch information
thescientist13 committed Dec 21, 2024
1 parent f8fb73e commit 0bde456
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/cli/src/lifecycles/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async function getDevServer(compilation) {
const current = await plugin.serve(url, request);
const merged = mergeResponse(response.clone(), current.clone());

response = merged;
response = merged.clone();
}
}

Expand Down Expand Up @@ -167,7 +167,7 @@ async function getDevServer(compilation) {
// don't interfere with external requests or API calls, only files
// and only run in development
if (process.env.__GWD_COMMAND__ === 'develop' && url.protocol === 'file:') { // eslint-disable-line no-underscore-dangle
// TODO there's probably a better way to do this with tee-ing streams but this works for now
// there's probably a better way to do this with tee-ing streams but this works for now
const { header, status, message } = ctx.response;
const response = new Response(ctx.body, {
statusText: message,
Expand Down

0 comments on commit 0bde456

Please sign in to comment.