mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-04-03 20:07:36 +03:00
Fix missing context in geo resources download
This commit is contained in:
parent
17584c245f
commit
c60a944aac
2 changed files with 13 additions and 3 deletions
|
@ -173,7 +173,11 @@ func (r *Router) downloadGeoIPDatabase(savePath string) error {
|
|||
},
|
||||
}
|
||||
defer httpClient.CloseIdleConnections()
|
||||
response, err := httpClient.Get(downloadURL)
|
||||
request, err := http.NewRequest("GET", downloadURL, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
response, err := httpClient.Do(request.WithContext(r.ctx))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -221,7 +225,11 @@ func (r *Router) downloadGeositeDatabase(savePath string) error {
|
|||
},
|
||||
}
|
||||
defer httpClient.CloseIdleConnections()
|
||||
response, err := httpClient.Get(downloadURL)
|
||||
request, err := http.NewRequest("GET", downloadURL, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
response, err := httpClient.Do(request.WithContext(r.ctx))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue