Authored by 周奇琪

如果是xhr,不走pipe

@@ -57,7 +57,7 @@ module.exports = function(proxyRoute) { @@ -57,7 +57,7 @@ module.exports = function(proxyRoute) {
57 logger.log('info','grayroute: request options: %j',options,{}); 57 logger.log('info','grayroute: request options: %j',options,{});
58 58
59 //发起代理请求 59 //发起代理请求
60 - if(req.headers['accept'].indexOf('text/html')>-1) { 60 + if(req.headers['accept'].indexOf('text/html')>-1||req.xhr) {
61 request(options,function(err,res,body) { 61 request(options,function(err,res,body) {
62 if(err) { 62 if(err) {
63 logger.log('error','grayroute: request error:',err); 63 logger.log('error','grayroute: request error:',err);