adminizer 4.3.0-build.128 → 4.3.0-build.129
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/lib/Adminizer.js +7 -1
- package/package.json +2 -2
package/lib/Adminizer.js
CHANGED
|
@@ -192,9 +192,15 @@ export class Adminizer {
|
|
|
192
192
|
if (requestOrigin && !isOriginAllowed) {
|
|
193
193
|
console.log(`❌ CORS: Blocked request from ${requestOrigin}`);
|
|
194
194
|
if (req.method === 'OPTIONS') {
|
|
195
|
+
// Для preflight - 200 без CORS headers
|
|
195
196
|
return res.status(200).end();
|
|
196
197
|
}
|
|
197
|
-
|
|
198
|
+
else {
|
|
199
|
+
// Для основных запросов - ошибка
|
|
200
|
+
return res.status(403).json({
|
|
201
|
+
error: 'CORS policy: Origin not allowed'
|
|
202
|
+
});
|
|
203
|
+
}
|
|
198
204
|
}
|
|
199
205
|
// Запрос с разрешенного origin или без Origin
|
|
200
206
|
if (isOriginAllowed) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adminizer",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.3.0-build.
|
|
4
|
+
"version": "4.3.0-build.129",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dev:no-seed-clean": "cross-env VITE_ENV=dev NO_SEED_DATA=true CLEAN_TMP=true ORM=sequelize tsx watch --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
17
17
|
"dev:waterline": "cross-env VITE_ENV=dev ORM=waterline tsx watch --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
18
18
|
"dev:waterline:no-seed": "cross-env VITE_ENV=dev NO_SEED_DATA=true ORM=waterline tsx watch --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
19
|
-
"dev:cors": "cross-env VITE_ENV=dev NO_SEED_DATA=true ORM=waterline FRONTEND_URL=http://localhost:
|
|
19
|
+
"dev:cors": "cross-env VITE_ENV=dev NO_SEED_DATA=true ORM=waterline FRONTEND_URL=http://localhost:8080 tsx watch --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
20
20
|
"build:assets": "vite build",
|
|
21
21
|
"compile:backend": "tsc -p src/tsconfig.json",
|
|
22
22
|
"compile:ui": "tsc -p tsconfig.ui.json",
|