sftp: prefix the id with app- and volume-
this helps the backend identify the type of mount
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
exports = module.exports = {
|
||||
proxy
|
||||
proxyAppData,
|
||||
proxyVolumeData
|
||||
};
|
||||
|
||||
const assert = require('assert'),
|
||||
@@ -12,10 +13,8 @@ const assert = require('assert'),
|
||||
services = require('../services.js'),
|
||||
url = require('url');
|
||||
|
||||
async function proxy(req, res, next) {
|
||||
assert.strictEqual(typeof req.params.id, 'string');
|
||||
|
||||
const id = req.params.id; // app id or volume id
|
||||
async function proxy(id, req, res, next) {
|
||||
assert.strictEqual(typeof id, 'string');
|
||||
|
||||
req.clearTimeout();
|
||||
|
||||
@@ -40,3 +39,11 @@ async function proxy(req, res, next) {
|
||||
next(new HttpError(500, error));
|
||||
});
|
||||
}
|
||||
|
||||
function proxyAppData(req, res, next) {
|
||||
proxy(`app-${req.params.id}`, req, res, next);
|
||||
}
|
||||
|
||||
function proxyVolumeData(req, res, next) {
|
||||
proxy(`volume-${req.params.id}`, req, res, next);
|
||||
}
|
||||
Reference in New Issue
Block a user