From 0046480231527620b5eae123f2eea4e4b8ab7685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?A=CC=81lvaro=20Manera?= Date: Mon, 22 Jun 2020 12:51:35 +0200 Subject: [PATCH] move middleware to sql-router --- lib/api/sql/query-controller.js | 2 -- lib/api/sql/sql-router.js | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/api/sql/query-controller.js b/lib/api/sql/query-controller.js index 1eb21a61..f9a8247a 100644 --- a/lib/api/sql/query-controller.js +++ b/lib/api/sql/query-controller.js @@ -19,7 +19,6 @@ const surrogateKey = require('../middlewares/surrogate-key'); const lastModified = require('../middlewares/last-modified'); const formatter = require('../middlewares/formatter'); const content = require('../middlewares/content'); -const clientHeader = require('../middlewares/client-header'); const { RATE_LIMIT_ENDPOINTS_GROUPS } = rateLimits; const PSQL = require('cartodb-psql'); @@ -56,7 +55,6 @@ module.exports = class QueryController { lastModified(), formatter(), content(), - clientHeader(), handleQuery({ stats: this.stats }) ]; }; diff --git a/lib/api/sql/sql-router.js b/lib/api/sql/sql-router.js index b0b4397e..2053d3de 100644 --- a/lib/api/sql/sql-router.js +++ b/lib/api/sql/sql-router.js @@ -10,6 +10,7 @@ const logger = require('../middlewares/logger'); const profiler = require('../middlewares/profiler'); const cors = require('../middlewares/cors'); const servedByHostHeader = require('../middlewares/served-by-host-header'); +const clientHeader = require('../middlewares/client-header'); const QueryController = require('./query-controller'); const CopyController = require('./copy-controller'); @@ -61,6 +62,7 @@ module.exports = class SqlRouter { sqlRouter.use(logger()); sqlRouter.use(profiler({ statsClient: this.statsClient })); sqlRouter.use(cors()); + sqlRouter.use(clientHeader()); sqlRouter.use(servedByHostHeader()); this.queryController.route(sqlRouter);