Skip to content

Commit 6c9bc6b

Browse files
authored
Merge pull request #5108 from nextcloud/copilot/fix-outdated-timestamp-reference
Update outdated LOOL references to COOL naming conventions
2 parents 5910c78 + fc8af0c commit 6c9bc6b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/Controller/WopiController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767

6868
#[RestrictToWopiServer]
6969
class WopiController extends Controller {
70-
// Signifies LOOL that document has been changed externally in this storage
71-
public const LOOL_STATUS_DOC_CHANGED = 1010;
70+
// Signifies COOL that document has been changed externally in this storage
71+
public const COOL_STATUS_DOC_CHANGED = 1010;
7272

7373
public const WOPI_AVATAR_SIZE = 64;
7474

@@ -588,15 +588,15 @@ public function putFile(string $fileId, string $access_token): JSONResponse {
588588
$file = $this->rootFolder->get($path);
589589
} else {
590590
$file = $this->getFileForWopiToken($wopi);
591-
$wopiHeaderTime = $this->request->getHeader('X-LOOL-WOPI-Timestamp');
591+
$wopiHeaderTime = $this->request->getHeader('X-COOL-WOPI-Timestamp');
592592

593593
if (!empty($wopiHeaderTime) && $wopiHeaderTime !== Helper::toISO8601($file->getMTime() ?? 0)) {
594594
$this->logger->debug('Document timestamp mismatch ! WOPI client says mtime {headerTime} but storage says {storageTime}', [
595595
'headerTime' => $wopiHeaderTime,
596596
'storageTime' => Helper::toISO8601($file->getMTime() ?? 0)
597597
]);
598598
// Tell WOPI client about this conflict.
599-
return new JSONResponse(['LOOLStatusCode' => self::LOOL_STATUS_DOC_CHANGED], Http::STATUS_CONFLICT);
599+
return new JSONResponse(['COOLStatusCode' => self::COOL_STATUS_DOC_CHANGED], Http::STATUS_CONFLICT);
600600
}
601601
}
602602

tests/features/bootstrap/WopiContext.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function collaboraPuts($source) {
8181
$options = [
8282
'body' => $file,
8383
'headers' => [
84-
'X-LOOL-WOPI-Timestamp' => $this->checkFileInfoResult['LastModifiedTime']
84+
'X-COOL-WOPI-Timestamp' => $this->checkFileInfoResult['LastModifiedTime']
8585
]
8686
];
8787
try {
@@ -287,7 +287,7 @@ public function collaboraSavesTheFileAs($source, $newName) {
287287
$options = [
288288
'body' => $file,
289289
'headers' => [
290-
'X-LOOL-WOPI-Timestamp' => $this->checkFileInfoResult['LastModifiedTime'],
290+
'X-COOL-WOPI-Timestamp' => $this->checkFileInfoResult['LastModifiedTime'],
291291
'X-WOPI-SuggestedTarget' => $newName,
292292
'X-WOPI-Override' => 'PUT_RELATIVE',
293293
]
@@ -303,7 +303,7 @@ public function collaboraRenamesTo($fileId, $newName) {
303303
$client = new Client();
304304
$options = [
305305
'headers' => [
306-
'X-LOOL-WOPI-Timestamp' => $this->checkFileInfoResult['LastModifiedTime'],
306+
'X-COOL-WOPI-Timestamp' => $this->checkFileInfoResult['LastModifiedTime'],
307307
'X-WOPI-RequestedName' => $newName,
308308
'X-WOPI-Override' => 'RENAME_FILE',
309309
],

0 commit comments

Comments
 (0)