Skip to content

Commit 5e29dd1

Browse files
committed
fix: add X-Forwarded-Proto and proxy changed to 1
1 parent bd09c86 commit 5e29dd1

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

api-gateway/src/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { routes } from "./routes";
77

88
const app:Application = express();
99

10-
app.set('trust proxy', 'loopback');
10+
app.set('trust proxy', 1);
1111

1212
app.use(morgan("dev"))
1313
app.use(express.json())

api-gateway/src/middleware/security.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const applySecurityMiddleware = (app: Application) => {
2323
},
2424
methods: ["GET", "POST", "HEAD", "PUT", "PATCH", "DELETE", "OPTIONS"],
2525
credentials: true,
26-
allowedHeaders: ['Content-Type', 'Authorization', 'Cookie', 'Range', 'Accept', 'X-Requested-With', 'X-Forwarded-For'],
26+
allowedHeaders: ['Content-Type', 'Authorization', 'Cookie', 'Range', 'Accept', 'X-Requested-With', 'X-Forwarded-For', 'X-Forwarded-Proto'],
2727
exposedHeaders: ['Content-Disposition', 'Content-Range', 'Accept-Ranges', 'Content-Length', 'Content-Type']
2828
}));
2929

0 commit comments

Comments
 (0)