From 6958ad0069656cc71ec2e4cae1cfc69954ba7410 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Tue, 16 Mar 2021 14:16:03 +0300 Subject: =?UTF-8?q?=F0=9F=91=B7=20Correct=20the=20http=20internal=20redire?= =?UTF-8?q?ct=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Valery Piashchynski --- plugins/http/config/http.go | 2 +- plugins/http/plugin.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/http') diff --git a/plugins/http/config/http.go b/plugins/http/config/http.go index d48ed022..8b63395f 100644 --- a/plugins/http/config/http.go +++ b/plugins/http/config/http.go @@ -97,7 +97,7 @@ func (c *HTTP) InitDefaults() error { } if c.SSLConfig.Address == "" { - c.SSLConfig.Address = ":443" + c.SSLConfig.Address = "127.0.0.1:443" } err := c.HTTP2Config.InitDefaults() diff --git a/plugins/http/plugin.go b/plugins/http/plugin.go index 0686f6b5..69d13bc8 100644 --- a/plugins/http/plugin.go +++ b/plugins/http/plugin.go @@ -418,7 +418,7 @@ func (s *Plugin) redirect(w http.ResponseWriter, r *http.Request) { RawQuery: r.URL.RawQuery, } - http.Redirect(w, r, target.String(), http.StatusTemporaryRedirect) + http.Redirect(w, r, target.String(), http.StatusPermanentRedirect) } // https://golang.org/pkg/net/http/#Hijacker -- cgit v1.2.3