Skip to content

Commit d734f05

Browse files
authored
Merge pull request #5158 from nextcloud/backport/5108/stable31
[stable31] Update LOOL to COOL naming conventions
2 parents f5f6d64 + 8118e7a commit d734f05

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
@@ -64,8 +64,8 @@
6464

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

7070
public const WOPI_AVATAR_SIZE = 64;
7171

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

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

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)