are you on node 0.10 ? in 0.10. Readable streams are paused by default, so
if you dont try to consume anything then there will be no end. add
on('data') or on('readable') or call resp.resume() or resp.read(0). any of
this will do
Am Dienstag, 14. Mai 2013 22:04:07 UTC+2 schrieb Rusty Conover:
>
> Hi,
>
> The end event on a HTTP response isn't emitted for the 204 or 304 status
> codes of HTTP. You can test it with this script below that never
> completes. Is this the intended behavior for these status codes that don't
> have a body? If it is the case, can we add something to the docs for the
> response event.
>
> Thanks,
>
> Rusty
>
>
> var HTTP = require('http'),
> assert = require('assert');
>
> var fakeServer = HTTP.createServer(function(request, res) {
> var u = request.url;
> u = u.replace('/', '');
> res.writeHead(u, {});
> res.end();
> }).listen(10222, function() {
> var url = 'http://localhost:10222/304';
> var request = HTTP.get(url, function(resp) {
> assert.ok(resp.statusCode === 304);
> resp.once('end', function() {
> console.log("Got end of request");
> fakeServer.close();
> });
> });
> });
>
>
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.