let's debug the things again
This commit is contained in:
parent
6a1242813b
commit
6eb7b84495
@ -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).
|
||||
|
Loading…
x
Reference in New Issue
Block a user