Add apps.upstreamUri support
This commit is contained in:
@@ -37,6 +37,7 @@ exports = module.exports = {
|
||||
setLocation,
|
||||
setStorage,
|
||||
setMounts,
|
||||
setUpstreamUri,
|
||||
|
||||
stop,
|
||||
start,
|
||||
@@ -898,6 +899,18 @@ async function setMounts(req, res, next) {
|
||||
next(new HttpSuccess(202, { taskId: result.taskId }));
|
||||
}
|
||||
|
||||
async function setUpstreamUri(req, res, next) {
|
||||
assert.strictEqual(typeof req.body, 'object');
|
||||
assert.strictEqual(typeof req.app, 'object');
|
||||
|
||||
if (typeof req.body.upstreamUri !== 'string') return next(new HttpError(400, 'upstreamUri must be a string'));
|
||||
|
||||
const [error] = await safe(apps.setUpstreamUri(req.app, req.body.upstreamUri, AuditSource.fromRequest(req)));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(200, {}));
|
||||
}
|
||||
|
||||
async function listEventlog(req, res, next) {
|
||||
assert.strictEqual(typeof req.app, 'object');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user