Merge pull request #3184 from chengzhichao-xydt/codex/ws-body-close

fix(channels): explicitly ignore resp.Body.Close() errors in websocket dial cleanup
This commit is contained in:
Mauro 2026-06-26 18:10:06 +02:00 committed by GitHub
commit 979f440af7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -88,7 +88,7 @@ func (c *PicoClientChannel) dial() error {
ws, resp, err := websocket.DefaultDialer.DialContext(c.ctx, c.config.URL, header) ws, resp, err := websocket.DefaultDialer.DialContext(c.ctx, c.config.URL, header)
if resp != nil && resp.Body != nil { if resp != nil && resp.Body != nil {
resp.Body.Close() _ = resp.Body.Close()
} }
if err != nil { if err != nil {
return err return err

View file

@ -62,7 +62,7 @@ func (c *WhatsAppChannel) Start(ctx context.Context) error {
conn, resp, err := dialer.Dial(c.url, nil) conn, resp, err := dialer.Dial(c.url, nil)
if resp != nil { if resp != nil {
resp.Body.Close() _ = resp.Body.Close()
} }
if err != nil { if err != nil {
c.cancel() c.cancel()