From ed9083de241be41061380bfad60e2a24374df488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 16 Mar 2018 20:02:18 +0100 Subject: [PATCH] Remove req2params middleware from ported server options --- .../ported/support/ported_server_options.js | 36 ------------------- 1 file changed, 36 deletions(-) diff --git a/test/acceptance/ported/support/ported_server_options.js b/test/acceptance/ported/support/ported_server_options.js index 8b75ec02..f6b7701e 100644 --- a/test/acceptance/ported/support/ported_server_options.js +++ b/test/acceptance/ported/support/ported_server_options.js @@ -49,42 +49,6 @@ module.exports = _.extend({}, serverOptions, { log_format: null, // do not log anything afterLayergroupCreateCalls: 0, useProfiler: true, - req2params: function(req, res, callback){ - - if ( req.query.testUnexpectedError ) { - return callback('test unexpected error'); - } - - // this is in case you want to test sql parameters eg ...png?sql=select * from my_table limit 10 - req.params = _.extend({}, req.params); - - if (req.params.token) { - req.params.token = LayergroupToken.parse(req.params.token).token; - } - - _.extend(req.params, req.query); - req.params.user = 'localhost'; - res.locals.user = 'localhost'; - - req.params.dbhost = global.environment.postgres.host; - req.params.dbport = req.params.dbport || global.environment.postgres.port; - - req.params.dbuser = 'test_windshaft_publicuser'; - if (req.params.dbname !== 'windshaft_test2') { - req.params.dbuser = 'test_windshaft_cartodb_user_1'; - } - req.params.dbname = 'test_windshaft_cartodb_user_1_db'; - - // add all params to res.locals - res.locals = _.extend({}, req.params); - - - // increment number of calls counter - global.req2params_calls = global.req2params_calls ? global.req2params_calls + 1 : 1; - - // send the finished req object on - callback(null,req); - }, afterLayergroupCreate: function(req, cfg, res, callback) { res.layercount = cfg.layers.length; // config.afterLayergroupCreateCalls++;