Skip to content
Snippets Groups Projects
Commit 0f994692 authored by syuilo's avatar syuilo
Browse files

HSTS


Co-Authored-By: default avatartamaina <tamaina@hotmail.co.jp>
parent b846eb8a
No related branches found
No related tags found
No related merge requests found
......@@ -41,6 +41,17 @@ app.use((req, res, next) => {
next();
});
/**
* HSTS
* 6month(15552000sec)
*/
if (config.url.startsWith('https')) {
app.use((req, res, next) => {
res.header('strict-transport-security', 'max-age=15552000; preload');
next();
});
}
// Drop request when without 'Host' header
app.use((req, res, next) => {
if (!req.headers['host']) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment