@co0ontty/wand 4.2.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/build-info.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"commit": "
|
|
3
|
-
"builtAt": "2026-07-
|
|
4
|
-
"version": "4.
|
|
2
|
+
"commit": "18f9ba6ad046ce59dc68669d11daf26d39e23f11",
|
|
3
|
+
"builtAt": "2026-07-15T07:37:39.130Z",
|
|
4
|
+
"version": "4.3.0",
|
|
5
5
|
"channel": "stable"
|
|
6
6
|
}
|
|
@@ -242,7 +242,11 @@ export function registerFileRoutes(app, deps) {
|
|
|
242
242
|
const baseName = path.basename(filePath);
|
|
243
243
|
const kind = classifyFile(ext, baseName);
|
|
244
244
|
const cap = RAW_MAX_BYTES_BY_KIND[kind] ?? RAW_MAX_BYTES_BY_KIND.binary;
|
|
245
|
-
|
|
245
|
+
// Inline responses are previews and stay size-bounded. Explicit downloads are
|
|
246
|
+
// streamed with range support, so keeping the preview cap here would make the
|
|
247
|
+
// file browser's "下载" action fail for the very files that are too large to
|
|
248
|
+
// preview.
|
|
249
|
+
if (!asDownload && fileStat.size > cap) {
|
|
246
250
|
res.status(413).json({
|
|
247
251
|
error: `文件超出可在线预览的上限(${Math.round(cap / 1024 / 1024)} MB)。`,
|
|
248
252
|
size: fileStat.size,
|