Skip to content

Missing _implicitHeader function in http.ServerResponse #124

@gbrail

Description

@gbrail

When the HTTP adapter is used, it goes down a different code path, so the undocumented _implicitHeader function is missing from http.ServerResponse.

This causes some very common code (the Expressjs "compress" middleware) to fail because those guys just love to depend on undocumented stuff. Yay Node.

The following monkey-patch, which can go anywhere as long as it's before the first HTTP response, helps:

var http = require('http');
http.ServerResponse.prototype._implicitHeader = function() {
this.writeHead(this.statusCode);
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions