Merge pull request #17107 from overleaf/jpa-x-update-source-2

[misc] remove ShareLaTeX branding from X-Update-Source header 2/2

GitOrigin-RevId: bebe0212a1f7b4c965cd55a22357e52dfce6dd30
This commit is contained in:
Jakob Ackermann
2024-02-19 09:04:09 +00:00
committed by Copybot
parent 4118775a49
commit b2dd70e0b4
2 changed files with 4 additions and 53 deletions
@@ -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)