node-restify
node-restify copied to clipboard
Status code 204 with Content-Length waits for timeout
Restify gets stuck on a response with status code 204 and 'Content-Lenght' header valued higher than 0, eventually times out and executes the callback function.
Example server:
const http = require('http');
const server = http.createServer((req, res) => {
const body = 'I\'m gonna go ahead and get you stuck for a bit...';
console.log(body);
res.writeHead(204, {
'Content-Length': Buffer.byteLength(body),
'Content-Type': 'text/plain',
});
res.end(body);
});
server.listen(8000, '127.0.0.1', () => {
console.log(`Server running ...`);
});
Example client:
const restify = require('restify');
const client = restify.createJsonClient({
url: 'http://localhost:8000'
});
const start = new Date().getTime();
client.del('/', () => {
console.log('Aaand I\'m done... Took me: ', ((new Date().getTime() - start)/1000), 's');
});
Sorry, but do you mind moving this issue over to: https://github.com/restify/clients/issues?
Thank you!
Done!
https://github.com/restify/clients/issues/76