app proxy: check the manifest id and not appStoreId

when installing via REST API or CLI, appStoreId will be empty.
This commit is contained in:
Girish Ramakrishnan
2023-09-27 19:30:50 +05:30
parent 7d5d857c28
commit 28397379e8
+1 -1
View File
@@ -953,7 +953,7 @@ async function setUpstreamUri(req, res, next) {
assert.strictEqual(typeof req.body, 'object');
assert.strictEqual(typeof req.app, 'object');
if (req.app.appStoreId !== constants.PROXY_APP_APPSTORE_ID) return next(new HttpError(400, 'upstreamUri can only be set for proxy app'));
if (req.app.manifest.id !== constants.PROXY_APP_APPSTORE_ID) return next(new HttpError(400, 'upstreamUri can only be set for proxy app'));
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)));