remove enforce https on production
This commit is contained in:
parent
45e91657c8
commit
e780ad27cd
1 changed files with 1 additions and 9 deletions
10
app/index.js
10
app/index.js
|
@ -11,7 +11,7 @@ import fastify from "fastify";
|
||||||
import helmet from "fastify-helmet";
|
import helmet from "fastify-helmet";
|
||||||
import ssr from "choo-ssr/fastify";
|
import ssr from "choo-ssr/fastify";
|
||||||
import statik from "fastify-static";
|
import statik from "fastify-static";
|
||||||
import websockets from "@inc/fastify-ws";
|
import websockets from "fastify-ws";
|
||||||
|
|
||||||
// U T I L S
|
// U T I L S
|
||||||
|
|
||||||
|
@ -63,14 +63,6 @@ server
|
||||||
if (redirects[request.raw.originalUrl])
|
if (redirects[request.raw.originalUrl])
|
||||||
reply.redirect(301, redirects[request.raw.originalUrl]);
|
reply.redirect(301, redirects[request.raw.originalUrl]);
|
||||||
|
|
||||||
if (process.env.NODE_ENV !== "development") {
|
|
||||||
if (request.headers["x-forwarded-proto"] !== "https")
|
|
||||||
reply.redirect(302, `https://${request.raw.hostname}${request.raw.originalUrl}`);
|
|
||||||
|
|
||||||
else
|
|
||||||
next();
|
|
||||||
}
|
|
||||||
|
|
||||||
next();
|
next();
|
||||||
})
|
})
|
||||||
.ready(err => {
|
.ready(err => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue