summaryrefslogtreecommitdiff
path: root/modules/caddyhttp
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-11-11 14:01:42 -0700
committerMatthew Holt <mholt@users.noreply.github.com>2019-11-11 14:01:42 -0700
commit16782d9988986a44e96337878e127363f29cccf6 (patch)
treec4fd17303c78d8488999dfd7580b5f0949c52209 /modules/caddyhttp
parentdfdddcfacba806bdce144aaba51568b41c7a480b (diff)
http: Use permanent redirects for HTTP->HTTPS
Diffstat (limited to 'modules/caddyhttp')
-rw-r--r--modules/caddyhttp/caddyhttp.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/caddyhttp/caddyhttp.go b/modules/caddyhttp/caddyhttp.go
index 1f16339..99a64c3 100644
--- a/modules/caddyhttp/caddyhttp.go
+++ b/modules/caddyhttp/caddyhttp.go
@@ -427,7 +427,7 @@ func (app *App) automaticHTTPS() error {
},
Handlers: []MiddlewareHandler{
StaticResponse{
- StatusCode: WeakString(strconv.Itoa(http.StatusTemporaryRedirect)), // TODO: use permanent redirect instead
+ StatusCode: WeakString(strconv.Itoa(http.StatusPermanentRedirect)),
Headers: http.Header{
"Location": []string{redirTo},
"Connection": []string{"close"},
@@ -447,8 +447,8 @@ func (app *App) automaticHTTPS() error {
var redirRoutes []Route
// for each redirect listener, see if there's already a
- // server configured to listen on that exact address; if
- // so, simply the redirect route to the end of its route
+ // server configured to listen on that exact address; if so,
+ // simply add the redirect route to the end of its route
// list; otherwise, we'll create a new server for all the
// listener addresses that are unused and serve the
// remaining redirects from it