Skip to content
Browse files

Added text/plain support.

  • Loading branch information...
1 parent 8282a80 commit 5c52d96bc25968037d9d23819b59ce8059a9f81e aoi0308 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 5c52d96

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