Skip to content

http: regression in Upgrade header handling #627

Closed
@bnoordhuis

Description

'use strict';

var assert = require('assert');
var http = require('http');
var net = require('net');

var seenUpgrade = 0;
process.on('exit', function() { assert.equal(seenUpgrade, 1); });

http.createServer(assert.fail).listen(0, '127.0.0.1', function() {
  this.on('upgrade', function(req, conn, head) {
    seenUpgrade += 1;
    conn.destroy();
    this.close();
  });
  var options = { host: this.address().address, port: this.address().port };
  net.connect(options, function() {
    this.write('GET / HTTP/1.1\r\n' +
               'Upgrade: Yes, please.\r\n' +
               '\r\n');
  });
});

Works with joyent/node@v0.11.16 but fails with iojs@5843ae8. The request callback is called and the 'upgrade' event doesn't fire. I'll bisect.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.httpIssues or PRs related to the http subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions