feat: fixed max-host-error blocking + progress mismatch + misc (#6193)

* feat: fixed max-host-error blocking wrong port for template with error

* feat: log total results with time taken at end of execution

* bugfix: skip non-executed requests with progress in flow protocol

* feat: fixed request calculation in http protocol for progress

* misc adjustments

---------

Co-authored-by: Ice3man <nizamulrana@gmail.com>
This commit is contained in:
Sandeep Singh
2025-05-07 17:22:15 +05:30
committed by GitHub
parent b9d0f2585f
commit 4801cc65ef
14 changed files with 168 additions and 41 deletions

View File

@@ -89,6 +89,9 @@ func (c *Cache) NormalizeCacheValue(value string) string {
u, err := url.ParseRequestURI(value)
if err != nil || u.Host == "" {
if strings.Contains(value, ":") {
return normalizedValue
}
u, err2 := url.ParseRequestURI("https://" + value)
if err2 != nil {
return normalizedValue
@@ -236,14 +239,19 @@ func (c *Cache) GetKeyFromContext(ctx *contextargs.Context, err error) string {
// should be reflected in contextargs but it is not yet reflected in some cases
// and needs refactor of ScanContext + ContextArgs to achieve that
// i.e why we use real address from error if present
address := ctx.MetaInput.Address()
// get address override from error
var address string
// 1. the address carried inside the error (if the transport sets it)
if err != nil {
tmp := errkit.GetAttrValue(err, "address")
if tmp.Any() != nil {
address = tmp.String()
if v := errkit.GetAttrValue(err, "address"); v.Any() != nil {
address = v.String()
}
}
if address == "" {
address = ctx.MetaInput.Address()
}
finalValue := c.NormalizeCacheValue(address)
return finalValue
}