diff --git a/pkg/protocol/client/client.go b/pkg/protocol/client/client.go index 777f55cdd..072a91a09 100644 --- a/pkg/protocol/client/client.go +++ b/pkg/protocol/client/client.go @@ -43,6 +43,7 @@ package client import ( "context" + "github.com/cloudwego/hertz/pkg/common/hlog" "sync" "time" @@ -220,8 +221,10 @@ func DoRequestFollowRedirects(ctx context.Context, req *protocol.Request, resp * redirectsCount := 0 for { + hlog.Infof("[Redirect] request url: %s", url) req.SetRequestURI(url) req.ParseURI() + hlog.Infof("[Redirect] request url parsed: %s", req.URI().String()) if err = c.Do(ctx, req, resp); err != nil { break @@ -241,7 +244,9 @@ func DoRequestFollowRedirects(ctx context.Context, req *protocol.Request, resp * err = errMissingLocation break } + hlog.Infof("[Redirect] redirect time: %d, origin url: %s, location: %s", redirectsCount, url, location) url = getRedirectURL(url, location) + hlog.Infof("[Redirect] after redirect process url: %s", url) } return statusCode, body, err