Skip to content

Commit

Permalink
Fix cookie test with newer versions of Node
Browse files Browse the repository at this point in the history
An HTTP header must not be set to an `undefined` value.
  • Loading branch information
mislav committed Dec 13, 2017
1 parent 7a692dc commit 7831671
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion script/server
Expand Up @@ -104,7 +104,10 @@ var routes = {
if (params.name) {
cookie = querystring.parse(req.headers['cookie'], '; ')[params.name];
}
res.writeHead(200, {'Content-Type': 'text/plain', 'Set-Cookie': setCookie});
res.writeHead(200, {
'Content-Type': 'text/plain',
'Set-Cookie': setCookie || ''
});
res.end(cookie);
},
'/headers': function(res) {
Expand Down

0 comments on commit 7831671

Please sign in to comment.