From 06b1235707a3efca7c2b3f44eb3145dd0fad507f Mon Sep 17 00:00:00 2001 From: William Petit Date: Thu, 6 Apr 2023 10:21:52 +0200 Subject: [PATCH] fix(module,app): handle hosts without port --- internal/agent/controller/app/server.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/internal/agent/controller/app/server.go b/internal/agent/controller/app/server.go index 23fa256..df34bcf 100644 --- a/internal/agent/controller/app/server.go +++ b/internal/agent/controller/app/server.go @@ -202,10 +202,7 @@ func unexpectedHostRedirect(hostTarget string, acceptedHostPatterns ...string) f fn := func(w http.ResponseWriter, r *http.Request) { host, port, err := net.SplitHostPort(r.Host) if err != nil { - logger.Error(r.Context(), "could not split host/port", logger.E(errors.WithStack(err))) - http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) - - return + host = r.Host } matched := wildcard.MatchAny(host, acceptedHostPatterns...)