Skip to content

Commit

Permalink
Add trust proxy setting to express server
Browse files Browse the repository at this point in the history
  • Loading branch information
prasadhonrao committed Oct 25, 2024
1 parent 2f96570 commit 588a96b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ app.use(mongoSanitize()); // Sanitize data
app.use(helmet()); // Set security headers
app.use(xss()); // Prevent cross site scripting attacks

// Trust the proxies
app.set('trust proxy', true);

const rateLimitMax = process.env.rate_limit_max || 100;
const rateLimitWindowMs = process.env.rate_limit_window || 15 * 60 * 1000; // Default to 15 minutes

Expand Down

0 comments on commit 588a96b

Please sign in to comment.