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

fix #414: use the statusCode and headers fields from the response.body instead of the response. #428

Merged

Conversation

yoshi-monster
Copy link
Contributor

This makes the production build behave the same to the dev version here:

const serverResponse = renderResult.body;
setHeaders(res, serverResponse.headers);
res.writeHead(serverResponse.statusCode);
res.end(serverResponse.body);

I would have liked to add some tests for this as well, but I could not find an existing place similar enough to add them to, and I didn't want to go ahead and just add end-to-end testing stuff that you might not want :)

…response.body instead of the response.

This makes the production build behave the same to the dev version (https://github.com/dillonkearns/elm-pages/blob/57dccef4334e264659af53465de786028e9566d9/generator/src/dev-server.js#L550-L553)

Note that statusCode also exists on the `response`, but is hard-coded to be 200 on the Elm side.
@netlify
Copy link

netlify bot commented Oct 27, 2023

👷 Deploy request for elm-pages-todos pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit e2eb656

@yoshi-monster yoshi-monster changed the title fix #414: use the statusCode and headers fields from the response.body instead of the repsonse. fix #414: use the statusCode and headers fields from the response.body instead of the response. Oct 27, 2023
@dillonkearns dillonkearns merged commit bcd64aa into dillonkearns:master Jan 22, 2024
@dillonkearns
Copy link
Owner

Thank you so much for the PR @jreusch4! And thank you @adamdicarlo0 for reporting as well. This will go out with the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants