Skip to content

Commit

Permalink
WebDAV: Fix wrong percentage inside log for PUT
Browse files Browse the repository at this point in the history
The WebDAV service for PUT operations had an erroneous log: it showed a
percentage between 0.00% and 1.00% (instead of 100%).

For example at 95.47% it printed:

    info: Upload progress for file file.zip: 0.9547245810048218% {"service":"internxt-webdav"}

This commit fixes that, logs now look like:

    info: Upload progress for file file.zip: 95.47% {"service":"internxt-webdav"}
  • Loading branch information
adrienverge committed Aug 21, 2024
1 parent eda3796 commit 797b0ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/webdav/handlers/PUT.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class PUTRequestHandler implements WebDavMethodHandler {
req,
{
progressCallback: (progress) => {
webdavLogger.info(`Upload progress for file ${resource.name}: ${progress}%`);
webdavLogger.info(`Upload progress for file ${resource.name}: ${(100*progress).toFixed(2)}%`);
},
},
);
Expand Down

0 comments on commit 797b0ff

Please sign in to comment.