From ef9f00630d6fd8d27c4bc054d25707740945f966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8A=A0=E9=87=8C?= <xiaofeng.mxf@taobao.com> Date: Fri, 29 Aug 2014 09:16:48 +0800 Subject: [PATCH] test config --- bin.js | 1 + lib/requestHandler.js | 18 +++++++++--------- rule_sample.js | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/bin.js b/bin.js index edd81b1..ea86b51 100644 --- a/bin.js +++ b/bin.js @@ -26,4 +26,5 @@ if(program.clear){ }); }else{ new proxy.proxyServer(program.type,program.port, program.host ,program.rule); + } \ No newline at end of file diff --git a/lib/requestHandler.js b/lib/requestHandler.js index 3dc58cb..542eb7c 100644 --- a/lib/requestHandler.js +++ b/lib/requestHandler.js @@ -257,16 +257,16 @@ function mergeCORSHeader(reqHeader,originHeader){ targetObj["access-control-allow-headers"] = reqHeader['access-control-request-headers'] || "-___-||"; // - targetObj["Transfer-Encoding"] = "chunked"; + // targetObj["Transfer-Encoding"] = "chunked"; - // Disable caching - // If the response status is 304 not modified, the data event of response will not emmit - targetObj["Cache-Control"] = "no-cache, no-store, must-revalidate"; - targetObj["Pragma"] = "no-cache"; - targetObj["Expires"] = 0; - // - targetObj["server"] = "anyproxy server"; - targetObj["x-powered-by"] = "Alipay-ct-wd"; + // // Disable caching + // // If the response status is 304 not modified, the data event of response will not emmit + // targetObj["Cache-Control"] = "no-cache, no-store, must-revalidate"; + // targetObj["Pragma"] = "no-cache"; + // targetObj["Expires"] = 0; + // // + // targetObj["server"] = "anyproxy server"; + // targetObj["x-powered-by"] = "Alipay-ct-wd"; return targetObj; } diff --git a/rule_sample.js b/rule_sample.js index 7470d01..9334d77 100644 --- a/rule_sample.js +++ b/rule_sample.js @@ -33,7 +33,7 @@ var rules = { ] ,"httpsConfig":{ "bypassAll" : false, //by setting this to true, anyproxy will not intercept any https request - "interceptDomains":[/www\.a\.com/,/www\.b\.com/] //by setting bypassAll:false, requests towards these domains will be intercepted, and try to meet the map rules above + "interceptDomains":[/www\.alipay\.com/,/www\.b\.com/] //by setting bypassAll:false, requests towards these domains will be intercepted, and try to meet the map rules above } }