From 07d023703133756e814be39fbe49b6232bb3ae20 Mon Sep 17 00:00:00 2001 From: Bobby Wibowo Date: Fri, 22 Jul 2022 02:02:59 +0700 Subject: [PATCH] refactor: res.query -> .query_parameters direct hyper-express prop get --- controllers/albumsController.js | 2 +- lolisafe.js | 2 +- routes/album.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/albumsController.js b/controllers/albumsController.js index 586f497..84c7715 100644 --- a/controllers/albumsController.js +++ b/controllers/albumsController.js @@ -511,7 +511,7 @@ self.getUpstreamCompat = async (req, res) => { } self.generateZip = async (req, res) => { - const versionString = parseInt(req.query.v) + const versionString = parseInt(req.query_parameters.v) const identifier = req.path_parameters.identifier if (identifier === undefined) { diff --git a/lolisafe.js b/lolisafe.js index 0f8d020..676c93f 100644 --- a/lolisafe.js +++ b/lolisafe.js @@ -180,7 +180,7 @@ if (config.cacheControl) { // Consider album ZIPs static as well, since they use version in their query string safe.use('/api/album/zip', (req, res, next) => { - const versionString = parseInt(req.query.v) + const versionString = parseInt(req.query_parameters.v) if (versionString > 0) { res.header('Cache-Control', cacheControls.static) } else { diff --git a/routes/album.js b/routes/album.js index 1c65f5d..3ee754e 100644 --- a/routes/album.js +++ b/routes/album.js @@ -23,7 +23,7 @@ routes.get('/a/:identifier', async (req, res) => { return errors.handleNotFound(req, res) } - const nojs = req.query.nojs !== undefined + const nojs = req.query_parameters.nojs !== undefined let cacheid if (process.env.NODE_ENV !== 'development') {