@marcel91200 / caddy Mirror · read-only / commits / 16782d99
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 14, 05:15 UTC

http: Use permanent redirects for HTTP->HTTPS

Matthew Holt committed Nov 11, 2019 at 14:01 UTC 16782d9988986a44e96337878e127363f29cccf6
1 file changed +3 -3
modules/caddyhttp/caddyhttp.go
+3 -3
@@ -427,7 +427,7 @@ func (app *App) automaticHTTPS() error {
427 },
428 Handlers: []MiddlewareHandler{
429 StaticResponse{
430 - StatusCode: WeakString(strconv.Itoa(http.StatusTemporaryRedirect)), // TODO: use permanent redirect instead
430 + StatusCode: WeakString(strconv.Itoa(http.StatusPermanentRedirect)),
431 Headers: http.Header{
432 "Location": []string{redirTo},
433 "Connection": []string{"close"},
@@ -447,8 +447,8 @@ func (app *App) automaticHTTPS() error {
447 var redirRoutes []Route
448
449 // for each redirect listener, see if there's already a
450 - // server configured to listen on that exact address; if
451 - // so, simply the redirect route to the end of its route
450 + // server configured to listen on that exact address; if so,
451 + // simply add the redirect route to the end of its route
452 // list; otherwise, we'll create a new server for all the
453 // listener addresses that are unused and serve the
454 // remaining redirects from it