Skip to content

Malformed HTTP request causes connection drop #4543

Closed
@triblondon

Description

@triblondon

Node:

var server = require('http').createServer(function(request, response){
    console.log('foo?');
    response.end('It Works!! Path Hit: ' + request.url);
});

server.listen(3200);

Telnet:

[andrew.betts ~]$ telnet localhost 3200
Connected to localhost.
GET HTTP/1.1 HTTP/1.1
Connection closed by foreign host.

Expected: An error to be thrown or the request to be handled.
Actual: No error is thrown, the server callback is not invoked, and the connection is closed.

This seems to suggest to me that it is impossible for me to correctly handle malformed HTTP requests from my Node application. I would like to be able to return a valid HTTP 400 Bad Request response.

Metadata

Metadata

Assignees

No one assigned

    Labels

    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