From 08ef781e771f4af0e0a24f69a642b824cc629376 Mon Sep 17 00:00:00 2001 From: KneeGrow <150595858+bobokaha@users.noreply.github.com> Date: Mon, 10 Nov 2025 02:33:04 +0800 Subject: [PATCH 1/4] refactor: improve allowed origins parsing logic for better clarity and handling --- index.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 48f9da4..fb3d5cf 100644 --- a/index.js +++ b/index.js @@ -17,7 +17,16 @@ import { startup } from './src/utils/startup.js'; import { fileURLToPath } from 'url'; const PORT = process.env.PORT; -const allowedOrigins = process.env.ALLOWED_ORIGINS?.split(',') || []; // localhost is also allowed. (from any localhost port) +const parseAllowedOrigins = (allowedOrigins) => { + if (!allowedOrigins) return []; + const stripped = allowedOrigins.trim().replace(/^\[|\]$/g, ''); + return stripped + .split(',') + .map((s) => s.trim().replace(/^\"|\"$|^\'|\'$/g, '')) + .filter(Boolean); +}; +// localhost is also allowed. (from any localhost port) +const allowedOrigins = parseAllowedOrigins(process.env.ALLOWED_ORIGINS) || []; const app = express(); app.use( From 2ff244bfb698190a39bdfc4ff8009aa03cbe82b9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 28 Nov 2025 00:55:21 +0000 Subject: [PATCH 2/4] chore: update dependencies to latest versions --- package-lock.json | 9 ++++----- package.json | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index e7b7047..1ff67cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "express": "^5.1.0", "node-cache": "^5.1.2", "node-fetch": "^3.3.2", - "prettier": "^3.6.2", + "prettier": "^3.7.1", "unpacker": "^1.0.1", "wyzie-lib": "^2.2.5" } @@ -1872,10 +1872,9 @@ "license": "MIT" }, "node_modules/prettier": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", - "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", - "license": "MIT", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.7.1.tgz", + "integrity": "sha512-RWKXE4qB3u5Z6yz7omJkjWwmTfLdcbv44jUVHC5NpfXwFGzvpQM798FGv/6WNK879tc+Cn0AAyherCl1KjbyZQ==", "bin": { "prettier": "bin/prettier.cjs" }, diff --git a/package.json b/package.json index bd5bd38..bcee54b 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "express": "^5.1.0", "node-cache": "^5.1.2", "node-fetch": "^3.3.2", - "prettier": "^3.6.2", + "prettier": "^3.7.1", "unpacker": "^1.0.1", "wyzie-lib": "^2.2.5" }, From c0d1c3675819f4fee301d3d049627cb1975853a7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 29 Nov 2025 00:56:10 +0000 Subject: [PATCH 3/4] chore: update dependencies to latest versions --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1ff67cd..cd7c46f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "express": "^5.1.0", "node-cache": "^5.1.2", "node-fetch": "^3.3.2", - "prettier": "^3.7.1", + "prettier": "^3.7.2", "unpacker": "^1.0.1", "wyzie-lib": "^2.2.5" } @@ -1872,9 +1872,9 @@ "license": "MIT" }, "node_modules/prettier": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.7.1.tgz", - "integrity": "sha512-RWKXE4qB3u5Z6yz7omJkjWwmTfLdcbv44jUVHC5NpfXwFGzvpQM798FGv/6WNK879tc+Cn0AAyherCl1KjbyZQ==", + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.7.2.tgz", + "integrity": "sha512-n3HV2J6QhItCXndGa3oMWvWFAgN1ibnS7R9mt6iokScBOC0Ul9/iZORmU2IWUMcyAQaMPjTlY3uT34TqocUxMA==", "bin": { "prettier": "bin/prettier.cjs" }, diff --git a/package.json b/package.json index bcee54b..ebc5935 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "express": "^5.1.0", "node-cache": "^5.1.2", "node-fetch": "^3.3.2", - "prettier": "^3.7.1", + "prettier": "^3.7.2", "unpacker": "^1.0.1", "wyzie-lib": "^2.2.5" }, From ab7e931a1deabcbd591a3fc7b35f33a8d2b15ba5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 30 Nov 2025 01:05:00 +0000 Subject: [PATCH 4/4] chore: update dependencies to latest versions --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index cd7c46f..2672ed1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "express": "^5.1.0", "node-cache": "^5.1.2", "node-fetch": "^3.3.2", - "prettier": "^3.7.2", + "prettier": "^3.7.3", "unpacker": "^1.0.1", "wyzie-lib": "^2.2.5" } @@ -1872,9 +1872,9 @@ "license": "MIT" }, "node_modules/prettier": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.7.2.tgz", - "integrity": "sha512-n3HV2J6QhItCXndGa3oMWvWFAgN1ibnS7R9mt6iokScBOC0Ul9/iZORmU2IWUMcyAQaMPjTlY3uT34TqocUxMA==", + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.7.3.tgz", + "integrity": "sha512-QgODejq9K3OzoBbuyobZlUhznP5SKwPqp+6Q6xw6o8gnhr4O85L2U915iM2IDcfF2NPXVaM9zlo9tdwipnYwzg==", "bin": { "prettier": "bin/prettier.cjs" }, diff --git a/package.json b/package.json index ebc5935..4bfc1b0 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "express": "^5.1.0", "node-cache": "^5.1.2", "node-fetch": "^3.3.2", - "prettier": "^3.7.2", + "prettier": "^3.7.3", "unpacker": "^1.0.1", "wyzie-lib": "^2.2.5" },