From 51e8f2a57f506e84cccdc922f3831b8ac0c0aa26 Mon Sep 17 00:00:00 2001 From: Aykhan Shahsuvarov Date: Fri, 2 Oct 2026 01:13:25 +0400 Subject: [PATCH] fix(script): match the main request default for the script http timeout --- docs/configuration.md | 2 +- internal/sarin/scripthttp.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index d883b8d..573da7b 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -599,7 +599,7 @@ http(url, opts) | `params` | table/object | - | Query parameters, added to any already in the URL | | `cookies` | table/object | - | Cookies, sent as a single `Cookie` header | | `body` | string | `""` | Request body | -| `timeout` | duration string (`"500ms"`) | `30s` | Request timeout (the `timeout` config does not apply), applied to each hop when redirects are followed | +| `timeout` | duration string (`"500ms"`) | `10s` | Request timeout (the `timeout` config does not apply), applied to each hop when redirects are followed | | `insecure` | boolean | `false` | Skip TLS verification (the `insecure` config does not apply) | | `maxRedirects` | number | `0` | How many redirects to follow, `0` follows none, maximum 100 | diff --git a/internal/sarin/scripthttp.go b/internal/sarin/scripthttp.go index c7f791f..daba97c 100644 --- a/internal/sarin/scripthttp.go +++ b/internal/sarin/scripthttp.go @@ -14,8 +14,8 @@ import ( "go.aykhans.me/sarin/internal/types" ) -// scriptHTTPDefaultTimeout is the default timeout for script requests, independent of -T. -const scriptHTTPDefaultTimeout = 30 * time.Second +// scriptHTTPDefaultTimeout is the default timeout for script requests. +const scriptHTTPDefaultTimeout = 10 * time.Second // scriptHTTPClient sends scripts' http.* requests. It is safe for concurrent use. type scriptHTTPClient struct {