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 API response handling #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

jaydm
Copy link
Contributor

@jaydm jaydm commented Oct 29, 2019

All responses from the API were getting their content type changed to 'application/octet-stream' because the structure of index.js was changing the content type for every request after it had already been set (to whatever it was supposed to be). Slightly re-arranged the code so that real data returned from fs.readFile was only sent when there was not an error.

Changed the respond function of api.js to combine the content type and character set assignment into a single line.

jaydm added 2 commits October 28, 2019 19:19
… to serve the 404 page when there is a problem finding the requested resource
@jaydm
Copy link
Contributor Author

jaydm commented Oct 29, 2019

This addresses issue #32

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.

1 participant