This commit is contained in:
想当当 2014-08-27 15:24:30 +08:00
parent 98599de892
commit 789bbba4e6

View File

@ -120,6 +120,9 @@ function userRequestHandler(req,userRes){
if(callback)callback(userRes); if(callback)callback(userRes);
userRes.end(); userRes.end();
}); });
res.on('error',function(error){
console.log('error',error);
});
}); });
@ -223,12 +226,17 @@ function mergeCORSHeader(reqHeader,originHeader){
targetObj["access-control-allow-methods"] = "GET, POST, PUT"; targetObj["access-control-allow-methods"] = "GET, POST, PUT";
targetObj["access-control-allow-headers"] = reqHeader['access-control-request-headers'] || "-___-||"; targetObj["access-control-allow-headers"] = reqHeader['access-control-request-headers'] || "-___-||";
//
targetObj["Transfer-Encoding"] = "chunked";
// Disable caching // Disable caching
// If the response status is 304 not modified, the data event of response will not emmit // If the response status is 304 not modified, the data event of response will not emmit
targetObj["Transfer-Encoding"] = "chunked"
targetObj["Cache-Control"] = "no-cache, no-store, must-revalidate"; targetObj["Cache-Control"] = "no-cache, no-store, must-revalidate";
targetObj["Pragma"] = "no-cache"; targetObj["Pragma"] = "no-cache";
targetObj["Expires"] = 0; targetObj["Expires"] = 0;
//
targetObj["server"] = "anyproxy server";
targetObj["x-powered-by"] = "Alipay-ct-wd";
return targetObj; return targetObj;
} }