From 236ff5ec7083b7cef92791b99e7625671f585bd2 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Wed, 4 Sep 2024 16:27:49 +0200 Subject: [PATCH] fix(Uploader): The mtime should be a valid UNIX timestamp Make sure it is a valid timestamp (integer), so no decimals. Signed-off-by: Ferdinand Thiessen --- lib/uploader.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/uploader.ts b/lib/uploader.ts index c5d95012..0beb82f8 100644 --- a/lib/uploader.ts +++ b/lib/uploader.ts @@ -467,7 +467,7 @@ export class Uploader { encodedDestinationFile, { ...this._customHeaders, - 'X-OC-Mtime': file.lastModified / 1000, + 'X-OC-Mtime': Math.floor(file.lastModified / 1000), 'OC-Total-Length': file.size, 'Content-Type': 'application/octet-stream', }, @@ -504,7 +504,7 @@ export class Uploader { url: `${tempUrl}/.file`, headers: { ...this._customHeaders, - 'X-OC-Mtime': file.lastModified / 1000, + 'X-OC-Mtime': Math.floor(file.lastModified / 1000), 'OC-Total-Length': file.size, Destination: encodedDestinationFile, }, @@ -550,7 +550,7 @@ export class Uploader { undefined, { ...this._customHeaders, - 'X-OC-Mtime': file.lastModified / 1000, + 'X-OC-Mtime': Math.floor(file.lastModified / 1000), 'Content-Type': file.type, }, )