I'm using Node v5.3.0 on Windows 10. I was playing with http and found out that a request with a header name constructor results to function Object() { [native code] },
Simple HTTP Server
consthttp=require('http');http.createServer((request,response)=>{response.end(JSON.stringify(request.headers,null,'\t'));}).listen(8000);Request
constnet=require('net');constclient=newnet.Socket();client.connect(8000,'127.0.0.1',()=>{client.write('GET / HTTP/1.1\r\nconstructor:\r\n\r\n');});client.on('data',(data)=>{console.log(data.toString());client.destroy();});client.on('close',function(){console.log('Connection closed');});Output
HTTP/1.1 200 OK
Date: Mon, 28 Dec 2015 21:17:55 GMT
Connection: keep-alive
Content-Length: 59
{
"constructor": "function Object() { [native code] }, "
}
Connection closed
I'm using Node v5.3.0 on Windows 10. I was playing with http and found out that a request with a header name
constructorresults tofunction Object() { [native code] },Simple HTTP Server
Request
Output