1
Fork 0
mirror of https://github.com/diced/zipline.git synced 2025-04-11 23:31:17 -05:00

Fix "could not formulate upload route"

This commit is contained in:
dicedtomato 2020-09-18 13:34:45 -07:00 committed by GitHub
parent 4ab13292ca
commit 9d57b15dfc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,7 +42,7 @@ export class ZiplineServer extends Server {
})
this.app.use(cookies());
try {
this.app.use(config.upload.route, express.static(config.uploader.upload));
this.app.use(config.uploader.route, express.static(config.uploader.upload));
} catch (e) {
Logger.get('TypeX.Routes').error(`Could not formulate upload static route`)
process.exit(1);
@ -52,7 +52,7 @@ export class ZiplineServer extends Server {
this.app.use(bodyParser.urlencoded({ extended: true }));
this.app.use(async (req, res, next) => {
if (!config.core.log) return next();
if (req.url.startsWith(config.upload.route)) return next();
if (req.url.startsWith(config.uploader.route)) return next();
let user = req.session.user;
const users = await orm.repos.user.find({ where: { token: req.headers['authorization'] } });
if (users[0]) user = users[0]