- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 33.6k
Closed
Labels
httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.
Description
- Version: v6.2.1
- Platform: ubuntu 14
test case
var http = require("http");
var headersArray = [
        ['Host','echo.websocket.org'],
        ['Connection','Upgrade'],
        ['Upgrade','websocket'],
        ['Origin','http://www.websocket.org'],
    ];
var headersObj = {
        'Host':'echo.websocket.org',
        'Connection':'Upgrade',
        'Upgrade':'websocket',
        'Origin':'http://www.websocket.org'
};
var req = http.request({
    method: "GET",
    host: "echo.websocket.org" ,
    path: "ws://echo.websocket.org/?encoding=text",
    headers: headersArray
});
req.on('response',function(res){
    console.log('response' , res.headers);
});
req.on('upgrade',function(res){
    console.log('upgrade',res.headers);
});
req.end();error output
_http_common.js:92
      (parser.outgoing._headers.upgrade === undefined ||
                               ^
TypeError: Cannot read property 'upgrade' of null
    at HTTPParser.parserOnHeadersComplete (_http_common.js:92:32)
    at Socket.socketOnData (_http_client.js:359:20)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:172:18)
    at Socket.Readable.push (_stream_readable.js:130:10)
    at TCP.onread (net.js:542:20)
Metadata
Metadata
Assignees
Labels
httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.