fix: add trust proxy for Cloudflare — fixes ERR_ERL_UNEXPECTED_X_FORWARDED_FOR in rate limiter
This commit is contained in:
parent
f8892f058f
commit
39dc5a4ab4
@ -16,6 +16,9 @@ import { blogRouter } from "./routes/blog";
|
|||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
|
// Trust Cloudflare proxy (required for express-rate-limit with X-Forwarded-For)
|
||||||
|
app.set("trust proxy", 1);
|
||||||
|
|
||||||
// Middleware
|
// Middleware
|
||||||
app.use(helmet({ contentSecurityPolicy: false }));
|
app.use(helmet({ contentSecurityPolicy: false }));
|
||||||
app.use(cors());
|
app.use(cors());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user