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

Fix failure if there's no content-type returned #929

Merged
merged 1 commit into from
Dec 11, 2017

Conversation

Pchelolo
Copy link
Contributor

Change-Id: Id5bf5c94dac06ec02a91137e3f0c002924d55301
@Pchelolo
Copy link
Contributor Author

Self-merge to deploy to beta cluster to allow testing of Page Previews T182639

@Pchelolo Pchelolo merged commit 289c64a into wikimedia:master Dec 11, 2017
@@ -47,7 +47,13 @@ function checkContentType(hyper, req, next, expectedContentType, responsePromise
return res;
}

if (res.headers && res.headers['content-type'] !== expectedContentType) {
if (res.headers && res.headers === undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I fail to see how this will ever evaluate to true. If res.headers === undefined then res.headers will always yield a false outcome, which means that the outcome will always be false. I also fail to see the benefit of deleting the content-type key in this circumstance.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh this is obviously a bug, it should read res.headers['content-type'] === undefined

This pull request was closed.
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.

2 participants