Extract shared HTTP client for search tools
The userAgentTransport and 15s timeout were inconsistently applied: government_db.go lost its timeout, wayback.go used a bare http.Client without the pooled transport or user-agent header. A new httpclient.go centralizes the setup so all search tools share the same configuration. Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
@@ -21,7 +21,6 @@ import (
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"time"
|
||||
|
||||
"go.probo.inc/probo/pkg/agent"
|
||||
)
|
||||
@@ -57,7 +56,7 @@ type (
|
||||
)
|
||||
|
||||
func CheckWaybackTool() agent.Tool {
|
||||
client := &http.Client{Timeout: 15 * time.Second}
|
||||
client := newHTTPClient()
|
||||
|
||||
return agent.FunctionTool(
|
||||
"check_wayback",
|
||||
|
||||
Reference in New Issue
Block a user