Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -289,7 +289,10 @@ Request.prototype.request = function () { | |
}) | ||
options.on("end", function () { | ||
response.body = buffer | ||
options.callback(null, response, buffer) | ||
if (options.json && response.headers['content-type'] === 'application/json') { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
benatkin
Author
Contributor
|
||
response.body = JSON.parse(response.body) | ||
} | ||
options.callback(null, response, response.body) | ||
}) | ||
} | ||
} | ||
|
1 comment
on commit 68c17f6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gah, this change totally broke our site, and it took a crazy long time to find and debug this...
I like the change, but it's really not nice to introduce breaking changes in a bugfix update! =/
What if the content-type is "application/json;charset=utf-8"?