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

Initial whitespace in .jss files causes headers to be sent #26

Open
tmalaher opened this issue Dec 16, 2015 · 0 comments
Open

Initial whitespace in .jss files causes headers to be sent #26

tmalaher opened this issue Dec 16, 2015 · 0 comments

Comments

@tmalaher
Copy link

This is a minor quibble, and easily fixed on the user side, but it's something that tripped me up.

I tried my first script by pasting the sample code from the web page into a file, and ended up with leading whitespace before the <?. This worked fine.

Later, I tried to override the content type by setting response.headers['content-type']='text/plain'; (or text/json or whatever.

But since the initial whitespace had already been sent with write, the sendHeaders function had already been called, so my change to the headers was "too late".

The write method could be modified to ignore a write that consists entirely of whitespace while isHeaderSent is false.

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

No branches or pull requests

1 participant