still adding shitty debug logs

This commit is contained in:
Adrien PONSIN 2025-04-15 20:05:10 +02:00
parent 21a66d786f
commit 113faf0212
No known key found for this signature in database
GPG Key ID: 7B4D4A32C05C475E

View File

@ -151,7 +151,9 @@ func (ph *ProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
log.Debug().Str("remote_addr", r.RemoteAddr).Str("http_method", r.Method).Str("path", r.URL.Path).Msg("incoming request")
mr, ok := containerMethodRegex["*"]
if ok {
fmt.Println("here 1")
if err := checkMethodPath(w, r, mr); err != nil {
fmt.Println("failed here 1")
log.Err(err).Send()
return
}
@ -165,20 +167,24 @@ 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)
fmt.Println("failed here 1")
fmt.Println("failed here 2")
log.Err(err).Send()
return
}
for _, resolvedIP := range resolvedIPs {
if resolvedIP.Equal(ip) {
if err = checkMethodPath(w, r, mr); err != nil {
fmt.Println("failed here 2")
fmt.Println("failed here 3")
log.Err(err).Send()
return
}
fmt.Println("here 2")
}
fmt.Println("here 3")
}
fmt.Println("here 4")
}
fmt.Println("here 5")
}
ph.rp.ServeHTTP(w, r)
}