Skip to content

Commit d62ebff

Browse files
committed
fix(trust): allow trust proxy to be set to true
1 parent 1c2c97e commit d62ebff

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/config/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export interface ConfigurationItemEnabled {
66
}
77

88
export interface ConfigurationSchema extends BaseConfitSchema {
9-
trustProxy?: string[];
9+
trustProxy?: string[] | boolean;
1010
logging?: {
1111
level?: Level;
1212
logHttpRequests?: boolean;

src/express-app/app.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ export async function startApp<
114114
app.locals.meter = metrics.getMeterProvider().getMeter(name);
115115
setupNodeMetrics(app.locals.meter, {});
116116

117-
if (config.trustProxy) {
117+
if (config.trustProxy === true) {
118+
app.enable('trust proxy');
119+
} else if (config.trustProxy) {
118120
app.set('trust proxy', config.trustProxy);
119121
}
120122

0 commit comments

Comments
 (0)