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

Strip inappropriate content-length response headers #101

Merged
merged 2 commits into from
Dec 31, 2014
Merged

Conversation

earldouglas
Copy link
Contributor

This has been the source of many a failed test when PUTting to /v1/en.wikipedia.test.local/test/Foo/wikitext/624484444.

@@ -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);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this to 40s a while ago to try to work around this problem.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.14%) when pulling c59a00a on content-length into 484a46a on master.

@@ -82,6 +82,10 @@ function handleResponse (opts, newReq, resp, response) {
resp.writeHead(response.status, '', response.headers);
resp.end(body);
} else {
if (response.headers && response.headers['content-length']) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can omit the check for response.headers, as we ensure that those are present in line 28.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.74%) when pulling 419362a on content-length into 484a46a on master.

gwicke added a commit that referenced this pull request Dec 31, 2014
Strip inappropriate content-length response headers
@gwicke gwicke merged commit c075063 into master Dec 31, 2014
@earldouglas earldouglas deleted the content-length branch December 31, 2014 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants