Skip to content
This repository was archived by the owner on Mar 19, 2019. It is now read-only.

Automatically chunk HTTP/1.1 Connection: close responses #259

Closed
halter73 opened this issue Oct 5, 2016 · 0 comments
Closed

Automatically chunk HTTP/1.1 Connection: close responses #259

halter73 opened this issue Oct 5, 2016 · 0 comments
Assignees
Milestone

Comments

@halter73
Copy link
Member

halter73 commented Oct 5, 2016

Chunked responses seem more reliable than relying on the TCP connection to close in order to end the response. Kestrel is changing it's behavior in 1.1 to automatically chunk HTTP/1.1 responses, even if they have the Connection: close header is set.

More context can be found here: aspnet/KestrelHttpServer#962 (comment)

Also FWIW, node.js follows the behavior I'm recommending. The following app will chunk given HTTP/1.1 request, but not for HTTP/1.0 requests of course.

var http = require('http');

var server = http.createServer(function (request, response) {
  response.writeHead(200, {"Content-Type": "text/plain", "Connection": "close"});
  response.end("Hello World!");
});

server.listen(8000);
console.log("Server running at http://127.0.0.1:8000/");
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants