diff --git a/services/web/app/src/Features/ThirdPartyDataStore/TpdsController.js b/services/web/app/src/Features/ThirdPartyDataStore/TpdsController.js index 6111189549..b4617a3d44 100644 --- a/services/web/app/src/Features/ThirdPartyDataStore/TpdsController.js +++ b/services/web/app/src/Features/ThirdPartyDataStore/TpdsController.js @@ -38,10 +38,7 @@ async function createProject(req, res) { async function mergeUpdate(req, res) { metrics.inc('tpds.merge-update') const { filePath, userId, projectId, projectName } = parseParams(req) - const source = - req.headers['x-sl-update-source'] || - req.headers['x-update-source'] || - 'unknown' + const source = req.headers['x-update-source'] || 'unknown' let metadata try { @@ -95,10 +92,7 @@ async function mergeUpdate(req, res) { async function deleteUpdate(req, res) { metrics.inc('tpds.delete-update') const { filePath, userId, projectId, projectName } = parseParams(req) - const source = - req.headers['x-sl-update-source'] || - req.headers['x-update-source'] || - 'unknown' + const source = req.headers['x-update-source'] || 'unknown' await TpdsUpdateHandler.promises.deleteUpdate( userId, @@ -147,10 +141,7 @@ async function updateFolder(req, res) { async function updateProjectContents(req, res, next) { const projectId = req.params.project_id const path = `/${req.params[0]}` // UpdateMerger expects leading slash - const source = - req.headers['x-sl-update-source'] || - req.headers['x-update-source'] || - 'unknown' + const source = req.headers['x-update-source'] || 'unknown' try { await UpdateMerger.promises.mergeUpdate(null, projectId, path, req, source) @@ -167,10 +158,7 @@ async function updateProjectContents(req, res, next) { async function deleteProjectContents(req, res, next) { const projectId = req.params.project_id const path = `/${req.params[0]}` // UpdateMerger expects leading slash - const source = - req.headers['x-sl-update-source'] || - req.headers['x-update-source'] || - 'unknown' + const source = req.headers['x-update-source'] || 'unknown' await UpdateMerger.promises.deleteUpdate(null, projectId, path, source) res.sendStatus(200) diff --git a/services/web/test/unit/src/ThirdPartyDataStore/TpdsControllerTests.js b/services/web/test/unit/src/ThirdPartyDataStore/TpdsControllerTests.js index 8d970abce7..848f24f0ff 100644 --- a/services/web/test/unit/src/ThirdPartyDataStore/TpdsControllerTests.js +++ b/services/web/test/unit/src/ThirdPartyDataStore/TpdsControllerTests.js @@ -115,43 +115,6 @@ describe('TpdsController', function () { } }) - it('should process the update with the update receiver by name and old header', function (done) { - this.req = { - params: { - 0: `${this.projectName}${this.path}`, - user_id: this.user_id, - project_id: '', - }, - headers: { - 'x-sl-update-source': (this.source = 'dropbox'), - }, - } - const res = { - json: payload => { - expect(payload).to.deep.equal({ - status: 'applied', - projectId: this.metadata.projectId.toString(), - entityId: this.metadata.entityId.toString(), - folderId: this.metadata.folderId.toString(), - entityType: this.metadata.entityType, - rev: this.metadata.rev.toString(), - }) - this.TpdsUpdateHandler.promises.newUpdate - .calledWith( - this.user_id, - '', // projectId - this.projectName, - this.path, - this.req, - this.source - ) - .should.equal(true) - done() - }, - } - this.TpdsController.mergeUpdate(this.req, res) - }) - it('should process the update with the update receiver by name', function (done) { const res = { json: payload => {