Просмотр исходного кода

Merge pull request #17108 from overleaf/jpa-tpds-remove-sl-prefix-1

[misc] remove ShareLaTeX branding from tpds job headers 1/2

GitOrigin-RevId: c4b028f037be6d4a312d8c62ea7ec603ec192bb0
Jakob Ackermann 2 лет назад
Родитель
Сommit
8c339045b3

+ 14 - 0
services/web/app/src/Features/ThirdPartyDataStore/TpdsUpdateSender.js

@@ -56,6 +56,11 @@ async function addEntity(params) {
         sl_entity_rev: rev,
         sl_project_id: projectId,
         sl_folder_id: folderId,
+        'x-entity-id': entityId,
+        'x-entity-rev': rev,
+        'x-entity-type': entityType,
+        'x-folder-id': folderId,
+        'x-project-id': projectId,
       },
       uri: buildTpdsUrl(userId, projectName, path),
       title: 'addFile',
@@ -124,6 +129,9 @@ async function deleteEntity(params) {
         sl_project_id: projectId,
         sl_entity_id: entityId,
         sl_entity_type: entityType,
+        'x-entity-id': entityId,
+        'x-entity-type': entityType,
+        'x-project-id': projectId,
       },
       uri: buildTpdsUrl(userId, projectName, path),
       // We're sending a body with the DELETE request. This is unconventional,
@@ -146,6 +154,7 @@ async function createProject(params) {
     method: 'post',
     headers: {
       sl_project_id: projectId.toString(),
+      'x-project-id': projectId,
     },
     uri: Path.join(
       tpdsUrl,
@@ -209,15 +218,20 @@ async function moveEntity(params) {
     const headers = {
       sl_project_id: projectId,
       sl_entity_rev: rev,
+      'x-project-id': projectId,
+      'x-entity-rev': rev,
     }
     if (entityId != null) {
       headers.sl_entity_id = entityId
+      headers['x-entity-id'] = entityId
     }
     if (entityType != null) {
       headers.sl_entity_type = entityType
+      headers['x-entity-type'] = entityType
     }
     if (folderId != null) {
       headers.sl_folder_id = folderId
+      headers['x-folder-id'] = folderId
     }
     const job = {
       method: 'put',