From 6eb7b844951628084634c7b4ab2e35f47bc4f4fe Mon Sep 17 00:00:00 2001 From: Adrien PONSIN Date: Wed, 16 Apr 2025 12:35:25 +0200 Subject: [PATCH] let's debug the things again --- command/serve.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/command/serve.go b/command/serve.go index ed65fff..dedff59 100644 --- a/command/serve.go +++ b/command/serve.go @@ -153,6 +153,7 @@ func (ph *ProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { if ok { if err := checkMethodPath(r, mr); err != nil { handleError(w, err) + log.Err(err).Send() return } } else { @@ -165,13 +166,15 @@ func (ph *ProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { resolvedIPs, err := net.LookupIP(containerName) if err != nil { http.Error(w, http.StatusText(http.StatusForbidden), http.StatusForbidden) - // log.Err(err).Send() + log.Err(err).Send() return } for _, resolvedIP := range resolvedIPs { + log.Debug().Msgf("resolvedIP: %s -- IP: %s", resolvedIP.String(), ip.String()) if resolvedIP.Equal(ip) { if err = checkMethodPath(r, mr); err != nil { handleError(w, err) + log.Err(err).Send() return } ph.rp.ServeHTTP(w, r) @@ -448,7 +451,6 @@ func addRequests() cli.Flag { Value: []string{"*:" + defaultAllowedRequest}, Aliases: middleman.PluckAlias(ServeCmd, addRequestsFlagName), Action: func(ctx context.Context, command *cli.Command, requests []string) error { - log.Info().Msgf("%d", len(requests)) clear(containerMethodRegex) for _, request := range requests { // An applicator is a container name/HTTP method pair e.g., nginx(GET).