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
Looking through the code it seems a bit undefined what happens if writeHead is called multiple times. Especially in the case where the headers have already been sent. I would expect at least the former to error but that does not seem to be the case.
Another potential problem with writeHead is that headers passed through this function are not accessible through getHeader. I'm not sure this is documented.
Another potential problem with writeHead is that headers passed through this function are not accessible through getHeader. I'm not sure this is documented.
If response.writeHead() method is called and this method has not been called, it will directly write the supplied header values onto the network channel without caching internally, and the response.getHeader() on the header will not yield the expected result. If progressive population of headers is desired with potential future retrieval and modification, use response.setHeader() instead of response.writeHead().
Looking through the code it seems a bit undefined what happens if
writeHeadis called multiple times. Especially in the case where the headers have already been sent. I would expect at least the former to error but that does not seem to be the case.