Skip to content
Browse files

Merge pull request #83 from aoi0308/master

Added text/plain support
  • Loading branch information...
2 parents 8282a80 + 5c52d96 commit 4939443befeda4291688e85281e7a7ca34143b7b @rauchg rauchg committed
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/browser.js
View
10 lib/browser.js
@@ -267,6 +267,16 @@ Browser.prototype.request = function(method, path, options, fn, saveHistory){
});
return;
}
+
+ // Buffer text
+ if (~contentType.indexOf('text/plain')) {
+ res.setEncoding('utf8');
+ res.on('data', function(chunk){ buf += chunk; });
+ res.on('end', function(){
+ fn(res, buf.toString());
+ });
+ return;
+ }
// Ensure html
if (!~contentType.indexOf('text/html')) {

0 comments on commit 4939443

Please sign in to comment.
Something went wrong with that request. Please try again.