refactor: res.query -> .query_parameters

direct hyper-express prop get
This commit is contained in:
Bobby Wibowo 2022-07-22 02:02:59 +07:00
parent 25f87b3a49
commit 07d0237031
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
3 changed files with 3 additions and 3 deletions

View File

@ -511,7 +511,7 @@ self.getUpstreamCompat = async (req, res) => {
} }
self.generateZip = 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 const identifier = req.path_parameters.identifier
if (identifier === undefined) { if (identifier === undefined) {

View File

@ -180,7 +180,7 @@ if (config.cacheControl) {
// Consider album ZIPs static as well, since they use version in their query string // Consider album ZIPs static as well, since they use version in their query string
safe.use('/api/album/zip', (req, res, next) => { safe.use('/api/album/zip', (req, res, next) => {
const versionString = parseInt(req.query.v) const versionString = parseInt(req.query_parameters.v)
if (versionString > 0) { if (versionString > 0) {
res.header('Cache-Control', cacheControls.static) res.header('Cache-Control', cacheControls.static)
} else { } else {

View File

@ -23,7 +23,7 @@ routes.get('/a/:identifier', async (req, res) => {
return errors.handleNotFound(req, res) return errors.handleNotFound(req, res)
} }
const nojs = req.query.nojs !== undefined const nojs = req.query_parameters.nojs !== undefined
let cacheid let cacheid
if (process.env.NODE_ENV !== 'development') { if (process.env.NODE_ENV !== 'development') {