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:
Émile Ré
2026-05-19 10:07:30 +04:00
parent a67ac462d7
commit ef6aca2c93
4 changed files with 42 additions and 20 deletions

View File

@@ -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",