chore: read response headers into a 64KiB buffer instead of 4KiB

This commit is contained in:
aykhans committed 2026-09-29 23:40:57 +04:00
1 parent e0f6d4aeba
commit fb8443fd25
2 files changed
+6 -4

No files matched your search

+2
View File
@@ -61,6 +61,7 @@ func NewHostClients(
ReadTimeout: timeout,
MaxResponseBodySize: safeUint64ToInt(maxResponseBody),
MaxIdemponentCallAttempts: 1,
ReadBufferSize: 64 << 10, // 64 KiB
DisableHeaderNamesNormalizing: true,
DisablePathNormalizing: true,
NoDefaultUserAgentHeader: true,
@@ -85,6 +86,7 @@ func NewHostClients(
ReadTimeout: timeout,
MaxResponseBodySize: safeUint64ToInt(maxResponseBody),
MaxIdemponentCallAttempts: 1,
ReadBufferSize: 64 << 10, // 64 KiB
DisableHeaderNamesNormalizing: true,
DisablePathNormalizing: true,
NoDefaultUserAgentHeader: true,
+4 -4
View File
@@ -56,11 +56,11 @@ func newScriptHTTPClient(
// Read and write timeouts stay unset because they would cap the per-call timeout,
// so dialWithDeadline is what bounds the TLS handshake.
return &fasthttp.Client{
DialTimeout: dialWithDeadline(dial),
MaxConnsPerHost: safeUintToInt(maxConns),
MaxResponseBodySize: safeUint64ToInt(maxResponseBody),
// Retries would send one script call several times and hide it from the results.
DialTimeout: dialWithDeadline(dial),
MaxConnsPerHost: safeUintToInt(maxConns),
MaxResponseBodySize: safeUint64ToInt(maxResponseBody),
MaxIdemponentCallAttempts: 1,
ReadBufferSize: 64 << 10, // 64 KiB
TLSConfig: &tls.Config{
InsecureSkipVerify: insecure, //nolint:gosec
},