mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-02 15:10:43 +02:00
fix webhook timeout bug (#15613)
* Also fix the potential problem in httplib
This commit is contained in:
1 parent
6ea6e2b4eb
commit
3d5bb3e6a3
2 files changed
+7
-10
No files matched your search
@@ -271,14 +271,10 @@ func InitDeliverHooks() {
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: setting.Webhook.SkipTLSVerify},
|
||||
Proxy: webhookProxy(),
|
||||
Dial: func(netw, addr string) (net.Conn, error) {
|
||||
conn, err := net.DialTimeout(netw, addr, timeout)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return conn, conn.SetDeadline(time.Now().Add(timeout))
|
||||
return net.DialTimeout(netw, addr, timeout) // dial timeout
|
||||
},
|
||||
},
|
||||
Timeout: timeout, // request timeout
|
||||
}
|
||||
|
||||
go graceful.GetManager().RunWithShutdownContext(DeliverHooks)
|
||||
|
||||
Reference in new issue
Block a user