summaryrefslogtreecommitdiff
path: root/internal/router/router.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-05-12 11:35:36 +0200
committerLibravatar GitHub <noreply@github.com>2022-05-12 11:35:36 +0200
commit898d256511fdddbc6b5e783116b07fd240b28819 (patch)
treecfb638820d9b3c6979329b77903567c30291c769 /internal/router/router.go
parent[bugfix] Add account raw note fix (#556) (diff)
downloadgotosocial-898d256511fdddbc6b5e783116b07fd240b28819.tar.xz
[bugfix] Fix server trying to listen twice on same address when l.e. enabled (#557)v0.3.3
Diffstat (limited to 'internal/router/router.go')
-rw-r--r--internal/router/router.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/internal/router/router.go b/internal/router/router.go
index 0367ba912..dbd39fc99 100644
--- a/internal/router/router.go
+++ b/internal/router/router.go
@@ -91,10 +91,6 @@ func (r *router) Start() {
http.Redirect(rw, r, target, http.StatusTemporaryRedirect)
})
- // Clone HTTP server but with autocert handler
- srv := r.srv
- srv.Handler = r.certManager.HTTPHandler(redirect)
-
// Start the LetsEncrypt autocert manager HTTP server.
go func() {
addr := fmt.Sprintf("%s:%d",
@@ -103,8 +99,7 @@ func (r *router) Start() {
)
logrus.Infof("letsencrypt listening on %s", addr)
-
- if err := srv.ListenAndServe(); err != nil &&
+ if err := http.ListenAndServe(addr, r.certManager.HTTPHandler(redirect)); err != nil &&
err != http.ErrServerClosed {
logrus.Fatalf("letsencrypt: listen: %s", err)
}