diff --git a/lib/server.js b/lib/server.js index 486b76ee0..b5fc49116 100644 --- a/lib/server.js +++ b/lib/server.js @@ -82,6 +82,14 @@ function handleResponse (opts, newReq, resp, response) { resp.writeHead(response.status, '', response.headers); resp.end(body); } else { + if (response.headers['content-length']) { + opts.log('warn/response/content-length', { + req: newReq, + res: response, + reason: new Error('Invalid content-length') + }); + delete response.headers['content-length']; + } resp.writeHead(response.status, '', response.headers); resp.end(); } diff --git a/test/features/pagecontent/pagecontent.js b/test/features/pagecontent/pagecontent.js index 417335bdd..3960596b2 100644 --- a/test/features/pagecontent/pagecontent.js +++ b/test/features/pagecontent/pagecontent.js @@ -40,7 +40,7 @@ module.exports = function (config) { }); }); it('should create a new html revision using proxy handler with id 624484444', function() { - this.timeout(40000); + this.timeout(20000); return preq.put({ uri: config.baseURL + '/test/Foo/wikitext/624484444', headers: { 'content-type': 'text/html' },