Skip to content

Commit 685a82e

Browse files
Handle http to https redirection
1 parent 7e94be5 commit 685a82e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

bin/ember-fastboot

+8-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ const httpServer = new ExpressHTTPServer(serverOptions);
3737

3838
const app = httpServer.app;
3939

40-
app.use(enforce.HTTPS({ trustProtoHeader: true }));
40+
app.use(
41+
enforce.HTTPS({
42+
trustProtoHeader: true,
43+
trustXForwardedHostHeader: true
44+
})
45+
);
4146

4247
app.use(
4348
express.static(distPath, {
@@ -52,6 +57,8 @@ app.use(
5257

5358
/** We rewrite the 307 location header into a relativeURL so that our special setup is handled */
5459
app.use(function(req, res, next) {
60+
console.log(req.headers['x-forwarded-host'], req.headers.host);
61+
5562
const originalSendFn = res.send;
5663

5764
res.send = function() {

0 commit comments

Comments
 (0)