From 93345a19b27d79b2c44bcdef3e9100abd170b3b2 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Tue, 4 Mar 2014 14:26:41 +0100 Subject: [PATCH] Do not log an error on GET / Closes #177 --- NEWS.md | 1 + lib/cartodb/cartodb_windshaft.js | 14 ++++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/NEWS.md b/NEWS.md index 6079d79f..ba88710d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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: diff --git a/lib/cartodb/cartodb_windshaft.js b/lib/cartodb/cartodb_windshaft.js index ad51767e..01df38f8 100644 --- a/lib/cartodb/cartodb_windshaft.js +++ b/lib/cartodb/cartodb_windshaft.js @@ -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; }