Do not log an error on GET /

Closes #177
This commit is contained in:
Sandro Santilli
2014-03-04 14:26:41 +01:00
parent 1741a20575
commit 93345a19b2
2 changed files with 7 additions and 8 deletions
+1
View File
@@ -6,6 +6,7 @@ Enhancements:
- Set statsd prefix for all endpoints
- Respond with a permission denied on attempt to access map tiles waiving
signature of someone who had not left any (#170)
- Do not log an error on GET / (#177)
Bug fixes:
+6 -8
View File
@@ -64,10 +64,11 @@ var CartodbWindshaft = function(serverOptions) {
}
var ws_sendResponse = ws.sendResponse;
// Routes used to create maps with GET,
// for which we don't want to request any caching.
// POST requests are never cached
var mapCreateRoutesGET = [
// GET routes for which we don't want to request any caching.
// POST/PUT/DELETE requests are never cached anyway.
var noCacheGETRoutes = [
'/',
// See https://github.com/CartoDB/Windshaft-cartodb/issues/176
serverOptions.base_url_mapconfig,
template_baseurl + '/:template_id/jsonp'
];
@@ -98,10 +99,7 @@ var CartodbWindshaft = function(serverOptions) {
// unsuccessful responses
return false;
}
if ( _.contains(mapCreateRoutesGET, req.route.path) ) {
// We do not want to cache
// map creation responses
// See https://github.com/CartoDB/Windshaft-cartodb/issues/176
if ( _.contains(noCacheGETRoutes, req.route.path) ) {
//console.log("Skipping cache channel in route:\n" + req.route.path);
return false;
}