@ossy/platform 1.15.2 → 1.15.3
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/package.json +4 -4
- package/src/server.js +12 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ossy/platform",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.3",
|
|
4
4
|
"description": "Ossy application server runtime",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"author": "Ossy <yourfriends@ossy.se> (https://ossy.se)",
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@ossy/router": "^1.16.
|
|
26
|
-
"@ossy/sdk": "^1.16.
|
|
25
|
+
"@ossy/router": "^1.16.3",
|
|
26
|
+
"@ossy/sdk": "^1.16.3",
|
|
27
27
|
"cookie-parser": "^1.4.7",
|
|
28
28
|
"dotenv": ">=16.0.0 <17.0.0",
|
|
29
29
|
"express": ">=5.0.0 <6.0.0",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"files": [
|
|
33
33
|
"src"
|
|
34
34
|
],
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "57ef30cf0b510dfb09b5b964cff3d847b9825360"
|
|
36
36
|
}
|
package/src/server.js
CHANGED
|
@@ -34,9 +34,19 @@ function loadManifest (buildDir) {
|
|
|
34
34
|
// The manifest is a flat `entries` array discriminated by `type`. Bucket
|
|
35
35
|
// them once at boot so the per-request hot path stays a simple lookup.
|
|
36
36
|
const entries = Array.isArray(manifest.entries) ? manifest.entries : []
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
// OssyRouter does `Object.entries(page.path)` on each route at lookup time,
|
|
38
|
+
// so a single malformed entry (missing `path`) crashes every request. The
|
|
39
|
+
// build is supposed to reject these — this is belt-and-suspenders for older
|
|
40
|
+
// builds and any future loosening of the build-time check.
|
|
41
|
+
const validRoutable = (e) => e.path !== undefined && e.path !== null
|
|
42
|
+
const pages = entries.filter((e) => e.type === 'page' && validRoutable(e))
|
|
43
|
+
const apis = entries.filter((e) => e.type === 'api' && validRoutable(e))
|
|
39
44
|
const tasks = entries.filter((e) => e.type === 'task')
|
|
45
|
+
for (const e of entries) {
|
|
46
|
+
if ((e.type === 'page' || e.type === 'api') && !validRoutable(e)) {
|
|
47
|
+
console.warn(`[@ossy/platform][server] Skipping ${e.type} "${e.id}" — manifest entry has no path.`)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
40
50
|
return {
|
|
41
51
|
entries,
|
|
42
52
|
pages,
|