Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug/issue 1350 make sure to clone responses when running resource plugin serve block in dev server #1357

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading