@bool-ts/core 1.0.10 → 1.0.11
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/hooks/factory.js +12 -5
- package/package.json +1 -1
- package/src/hooks/factory.ts +12 -5
package/dist/hooks/factory.js
CHANGED
|
@@ -69,8 +69,8 @@ export const BoolFactory = (target) => {
|
|
|
69
69
|
});
|
|
70
70
|
app.set("etag", "strong");
|
|
71
71
|
app.set("query parser", (query) => Qs.parse(query, {
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
depth: 10,
|
|
73
|
+
arrayLimit: 50
|
|
74
74
|
}));
|
|
75
75
|
app.use(urlencoded({
|
|
76
76
|
extended: true,
|
|
@@ -122,8 +122,13 @@ export const BoolFactory = (target) => {
|
|
|
122
122
|
if (!allowOrigins.includes("*")) {
|
|
123
123
|
if (!allowOrigins.includes(req.headers.origin || "*")) {
|
|
124
124
|
return res.status(403).json({
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
httpCode: 403,
|
|
126
|
+
data: {
|
|
127
|
+
origin: {
|
|
128
|
+
code: "origin:invalid:0x00001",
|
|
129
|
+
message: "Invalid origin."
|
|
130
|
+
}
|
|
131
|
+
}
|
|
127
132
|
});
|
|
128
133
|
}
|
|
129
134
|
}
|
|
@@ -133,7 +138,9 @@ export const BoolFactory = (target) => {
|
|
|
133
138
|
res.header("Access-Control-Allow-Methods", allowMethods.join(", "));
|
|
134
139
|
next();
|
|
135
140
|
});
|
|
136
|
-
|
|
141
|
+
if (routers.length > 0) {
|
|
142
|
+
app.use(routers);
|
|
143
|
+
}
|
|
137
144
|
return app;
|
|
138
145
|
};
|
|
139
146
|
export default BoolFactory;
|
package/package.json
CHANGED
package/src/hooks/factory.ts
CHANGED
|
@@ -88,8 +88,8 @@ export const BoolFactory = (
|
|
|
88
88
|
|
|
89
89
|
app.set("etag", "strong");
|
|
90
90
|
app.set("query parser", (query: string) => Qs.parse(query, {
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
depth: 10,
|
|
92
|
+
arrayLimit: 50
|
|
93
93
|
}));
|
|
94
94
|
|
|
95
95
|
app.use(
|
|
@@ -152,8 +152,13 @@ export const BoolFactory = (
|
|
|
152
152
|
if (!allowOrigins.includes("*")) {
|
|
153
153
|
if (!allowOrigins.includes(req.headers.origin || "*")) {
|
|
154
154
|
return res.status(403).json({
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
httpCode: 403,
|
|
156
|
+
data: {
|
|
157
|
+
origin: {
|
|
158
|
+
code: "origin:invalid:0x00001",
|
|
159
|
+
message: "Invalid origin."
|
|
160
|
+
}
|
|
161
|
+
}
|
|
157
162
|
});
|
|
158
163
|
}
|
|
159
164
|
}
|
|
@@ -166,7 +171,9 @@ export const BoolFactory = (
|
|
|
166
171
|
next();
|
|
167
172
|
});
|
|
168
173
|
|
|
169
|
-
|
|
174
|
+
if (routers.length > 0) {
|
|
175
|
+
app.use(routers);
|
|
176
|
+
}
|
|
170
177
|
|
|
171
178
|
return app;
|
|
172
179
|
}
|