Skip to content

Instantly share code, notes, and snippets.

@isaacs
Created January 24, 2010 08:49
Show Gist options
  • Save isaacs/285107 to your computer and use it in GitHub Desktop.
Save isaacs/285107 to your computer and use it in GitHub Desktop.
// these are all the same.
require("http").createServer(function (req,res) {
res.sendHeader(200, {
"set-cookie" : [ "foo=bar", "bar=baz" ],
"x" : ["y", "z"],
"y" : ["a", "b"]
});
res.finish();
}).listen(8000, "localhost");
require("http").createServer(function (req,res) {
res.sendHeader(200, [
["set-cookie", "foo=bar", "bar=baz"],
["x", "y", "z"],
["y", "a", "b"]
]);
res.finish();
}).listen(8001, "localhost");
require("http").createServer(function (req,res) {
res.sendHeader(200, [
["set-cookie", ["foo=bar", "bar=baz"]],
["x", ["y", "z"]],
["y", ["a", "b"]]
]);
res.finish();
}).listen(8002, "localhost");
require("http").createServer(function (req,res) {
res.sendHeader(200, [
["set-cookie", "foo=bar"],
["set-cookie", "bar=baz"],
["x", "y"],
["x", "z"],
["y", "a"],
["y", "b"]
]);
res.finish();
}).listen(8003, "localhost");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment