Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

db.exists() is broken: with "keep-alive" and HEAD method callback is not invoked. #289

Open
shakiba opened this issue Jul 8, 2015 · 1 comment

Comments

@shakiba
Copy link

shakiba commented Jul 8, 2015

db.exists() sends "keep-alive" HEAD requests, but at least for me (io.js v1.0.3) it doesn't works and db.exists() callback is never invoked. Following code reproduces this issue: "GET keep-alive", "GET close" and "HEAD close" are called but "HEAD keep-alive" is not called.

var http = require('http');
var request = require('request');

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

server.listen(8596);

new (request.Request)({
  uri : 'http://localhost:8596/',
  method : 'HEAD',
  headers : {
    Connection : 'keep-alive'
  },
  callback : function(a, b, c) {
    console.log('HEAD keep-alive');
  }
});

new (request.Request)({
  uri : 'http://localhost:8596/',
  method : 'GET',
  headers : {
    Connection : 'keep-alive'
  },
  callback : function(a, b, c) {
    console.log('GET keep-alive');
  }
});

new (request.Request)({
  uri : 'http://localhost:8596/',
  method : 'HEAD',
  callback : function(a, b, c) {
    console.log('HEAD close');
  }
});

new (request.Request)({
  uri : 'http://localhost:8596/',
  method : 'GET',
  callback : function(a, b, c) {
    console.log('GET close');
  }
});
@thomasmodeneis
Copy link

is this issue still relevant ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants