@proteinjs/db-file 1.3.5 → 1.3.6
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.3.6](https://github.com/proteinjs/db/compare/@proteinjs/db-file@1.3.5...@proteinjs/db-file@1.3.6) (2026-07-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **db-file:** a zero-byte file serves 200, not 404 ([7407783](https://github.com/proteinjs/db/commit/740778304ca33a356601a5df51fc00c3f1eacc8e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [1.3.5](https://github.com/proteinjs/db/compare/@proteinjs/db-file@1.3.4...@proteinjs/db-file@1.3.5) (2026-07-24)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @proteinjs/db-file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFile.d.ts","sourceRoot":"","sources":["../../../src/routes/getFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAI9C,eAAO,MAAM,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"getFile.d.ts","sourceRoot":"","sources":["../../../src/routes/getFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAI9C,eAAO,MAAM,OAAO,EAAE,KA6BrB,CAAC"}
|
|
@@ -62,7 +62,8 @@ exports.getFile = {
|
|
|
62
62
|
return [4 /*yield*/, fileStorage.getFileData(fileId)];
|
|
63
63
|
case 3:
|
|
64
64
|
fileDataBase64 = _a.sent();
|
|
65
|
-
|
|
65
|
+
// The file row decides existence; empty data is a legitimate zero-byte file, not a 404.
|
|
66
|
+
if (!file) {
|
|
66
67
|
response.status(404).send('File not found');
|
|
67
68
|
}
|
|
68
69
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFile.js","sourceRoot":"","sources":["../../../src/routes/getFile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,8CAAgD;AAChD,wCAA2C;AAE9B,QAAA,OAAO,GAAU;IAC5B,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,UAAO,OAAO,EAAE,QAAQ;;;;;oBACjC,IAAI,CAAC,eAAQ,CAAC,UAAU,EAAE,EAAE;wBAC1B,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;wBAChD,sBAAO;qBACR;oBAEK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC3B,WAAW,GAAG,IAAA,4BAAc,GAAE,CAAC;;;;oBAEtB,qBAAM,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,EAAA;;oBAAxC,IAAI,GAAG,SAAiC;oBACvB,qBAAM,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,EAAA;;oBAAtD,cAAc,GAAG,SAAqC;oBAC5D,IAAI,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"getFile.js","sourceRoot":"","sources":["../../../src/routes/getFile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,8CAAgD;AAChD,wCAA2C;AAE9B,QAAA,OAAO,GAAU;IAC5B,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,UAAO,OAAO,EAAE,QAAQ;;;;;oBACjC,IAAI,CAAC,eAAQ,CAAC,UAAU,EAAE,EAAE;wBAC1B,QAAQ,CAAC,MAAM,CAA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.3.
|
|
3
|
+
"version": "1.3.6",
|
|
4
4
|
"description": "File storage in the db",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
},
|
|
45
45
|
"main": "./dist/generated/index.js",
|
|
46
46
|
"types": "./dist/generated/index.d.ts",
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "f2259b2344292a4e2a168c56ad98ac1649eab993"
|
|
48
48
|
}
|
package/src/routes/getFile.ts
CHANGED
|
@@ -16,7 +16,8 @@ export const getFile: Route = {
|
|
|
16
16
|
try {
|
|
17
17
|
const file = await fileStorage.getFile(fileId);
|
|
18
18
|
const fileDataBase64 = await fileStorage.getFileData(fileId);
|
|
19
|
-
|
|
19
|
+
// The file row decides existence; empty data is a legitimate zero-byte file, not a 404.
|
|
20
|
+
if (!file) {
|
|
20
21
|
response.status(404).send('File not found');
|
|
21
22
|
} else {
|
|
22
23
|
const safeFilename = encodeURIComponent(file.name);
|