fix: #10358, bad uploads path

This commit is contained in:
Julian Lam
2022-03-02 11:41:10 -05:00
parent 37ef8366d0
commit 5479f36443

View File

@@ -1,5 +1,7 @@
'use strict';
const path = require('path');
const nconf = require('nconf');
const db = require('../../database');
@@ -27,7 +29,7 @@ uploadsController.get = async function (req, res, next) {
userData.uploads = uploadNames.map(uploadName => ({
name: uploadName,
url: nconf.get('upload_url') + uploadName,
url: path.resolve(nconf.get('upload_url'), uploadName),
}));
const pageCount = Math.ceil(itemCount / itemsPerPage);
userData.pagination = pagination.create(page, pageCount, req.query);