You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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';
(ortext/json
or whatever.But since the initial whitespace had already been sent with
write
, thesendHeaders
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.The text was updated successfully, but these errors were encountered: