From aab705f4a402369983e4b0b90db95fe2376abce9 Mon Sep 17 00:00:00 2001 From: Philipp Heckel Date: Fri, 21 Jan 2022 14:17:59 -0500 Subject: [PATCH] Fix baseURL check --- cmd/serve.go | 2 +- server/server.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/serve.go b/cmd/serve.go index 63119b9d..2a958c09 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -124,7 +124,7 @@ func execServe(c *cli.Context) error { return errors.New("if smtp-server-listen is set, smtp-server-domain must also be set") } else if attachmentCacheDir != "" && baseURL == "" { return errors.New("if attachment-cache-dir is set, base-url must also be set") - } else if baseURL != "" && (strings.HasPrefix(baseURL, "http://") || strings.HasPrefix(baseURL, "https://")) { + } else if baseURL != "" && !strings.HasPrefix(baseURL, "http://") && !strings.HasPrefix(baseURL, "https://") { return errors.New("if set, base-url must start with http:// or https://") } diff --git a/server/server.go b/server/server.go index ef372cd7..4a59bc6d 100644 --- a/server/server.go +++ b/server/server.go @@ -269,7 +269,7 @@ func (s *Server) Run() error { s.mu.Unlock() go s.runManager() go s.runAtSender() - go s.runFirebaseKeepliver() + go s.runFirebaseKeepaliver() return <-errChan } @@ -1052,7 +1052,7 @@ func (s *Server) runAtSender() { } } -func (s *Server) runFirebaseKeepliver() { +func (s *Server) runFirebaseKeepaliver() { if s.firebase == nil { return }