fix: req.Close only for non-GET (fixes FindInstanceByDisplayName), bump 5.0.65

This commit is contained in:
“Naeel”
2026-07-08 20:11:30 +04:00
parent 6d3bfe852c
commit f59b9ca19b
4 changed files with 8 additions and 5 deletions
+5 -2
View File
@@ -978,8 +978,11 @@ func (c *UniversalClient) doRequest(ctx context.Context, method, path string, pa
return nil, nil, err
}
// Форсируем новое TCP-соединение: DDoS-Guard может блочить POST на keep-alive
req.Close = true
// Форсируем новое TCP-соединение для POST/PUT/PATCH: DDoS-Guard может блочить их на keep-alive.
// GET-запросы (поиск, чтение) оставляем на keep-alive — req.Close на них ломает DDoS-Guard.
if method != "GET" {
req.Close = true
}
req.Header.Set("User-Agent", userAgent)
req.Header.Set("Accept", "*/*")
+1 -1
View File
@@ -17,7 +17,7 @@ import (
)
var (
version string = "5.0.64"
version string = "5.0.65"
)
func main() {