aboutsummaryrefslogtreecommitdiff
path: root/modules/ext
diff options
context:
space:
mode:
Diffstat (limited to 'modules/ext')
-rw-r--r--modules/ext/webdav.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/ext/webdav.js b/modules/ext/webdav.js
index e78e876..c7efbf9 100644
--- a/modules/ext/webdav.js
+++ b/modules/ext/webdav.js
@@ -480,7 +480,10 @@ class WebDAVModule {
entries.push({
name: decodeURIComponent(href.replace(/\/$/, '').split('/').pop() || href),
type: isDir ? 'dir' : 'file',
- size: 0,
+ // null, not 0: these are the fallback parsers, which cannot see the
+ // size column. 0 rendered as "0 B", i.e. a listing that looked like
+ // every file was empty (the bug _parseAutoindexSize fixes upstream).
+ size: null,
mtime: null,
href: href
});
@@ -496,7 +499,10 @@ class WebDAVModule {
entries.push({
name: decodeURIComponent(href.replace(/\/$/, '').split('/').pop() || href),
type: isDir ? 'dir' : 'file',
- size: 0,
+ // null, not 0: these are the fallback parsers, which cannot see the
+ // size column. 0 rendered as "0 B", i.e. a listing that looked like
+ // every file was empty (the bug _parseAutoindexSize fixes upstream).
+ size: null,
mtime: null,
href: href
});
@@ -2479,6 +2485,7 @@ class WebDAVModule {
}
_formatSize(bytes) {
+ if (bytes === null || bytes === undefined) return '—'; // listing could not determine it
const n = Number(bytes);
if (!Number.isFinite(n) || n < 0) return '—';
if (n < 1024) return n + ' B';