Skip to content

Commit aae7270

Browse files
authored
Merge pull request #33 from thehansys/main
Added redirect to HTTPS
2 parents 2cb8cc8 + c0ea17f commit aae7270

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,8 @@ npm-debug.log
3737

3838
# SQLite3 database files.
3939
*.db
40-
*.db-*
40+
*.db-*
41+
42+
# IDEs
43+
.vscode
44+
.idea

cdn-config/routes.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ import { Router, edgioRoutes } from '@edgio/core'
55
// Edgio automatically respects all cache headers, we don't have to setup anything here.
66

77
export default new Router()
8+
// Redirect HTTP to HTTPS
9+
.match({
10+
scheme: "HTTP",
11+
}, ({ setResponseHeader, setResponseCode }) => {
12+
setResponseHeader("Location", "https://%{host}%{normalized_uri}")
13+
// Change to 301 when you see the correct redirect on your site
14+
setResponseCode(302)
15+
})
16+
817
// https://developer.chrome.com/blog/private-prefetch-proxy/
918
.match("/.well-known/traffic-advice", ({ send, setResponseHeader, cache }) => {
1019
setResponseHeader("Content-Type", "application/trafficadvice+json");

0 commit comments

Comments
 (0)