auto-smart-security 1.0.5 → 1.0.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/dist/apply-security.js +3 -1
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
package/dist/apply-security.js
CHANGED
|
@@ -13,7 +13,9 @@ function applySecurity(app, options) {
|
|
|
13
13
|
// Dev mode → skip security
|
|
14
14
|
if (options.mode === 'dev')
|
|
15
15
|
return;
|
|
16
|
-
|
|
16
|
+
if (options.trustProxy !== undefined) {
|
|
17
|
+
app.set('trust proxy', options.trustProxy);
|
|
18
|
+
}
|
|
17
19
|
/** ================= BLACKLIST STORE ================= */
|
|
18
20
|
const blacklist = options.blacklist?.store ??
|
|
19
21
|
new memory_store_1.MemoryBlacklistStore(options.staticBlacklist, options.blacklistTTL);
|
package/dist/types.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export interface BotOptions {
|
|
|
18
18
|
export interface SecurityOptions {
|
|
19
19
|
/** dev → skip security */
|
|
20
20
|
mode?: 'prod' | 'dev';
|
|
21
|
+
/** express trust proxy setting */
|
|
22
|
+
trustProxy?: boolean | number | string;
|
|
21
23
|
/** allow only these paths */
|
|
22
24
|
pathWhitelist: string[];
|
|
23
25
|
/** hard blacklist */
|