1
0
mirror of https://github.com/IceWhaleTech/CasaOS.git synced 2025-07-12 23:50:14 +02:00

fix potential goroutine leak due to http request without a timeout (#656)

This commit is contained in:
Tiger Wang
2022-11-03 18:07:49 -04:00
committed by GitHub
parent 43cc7596d2
commit 29e701cb7c
3 changed files with 5 additions and 4 deletions

View File

@ -12,6 +12,7 @@ import (
"time"
"unsafe"
http2 "github.com/IceWhaleTech/CasaOS-Common/utils/http"
"github.com/IceWhaleTech/CasaOS/model"
"github.com/IceWhaleTech/CasaOS/pkg/config"
"github.com/IceWhaleTech/CasaOS/pkg/utils/common_err"
@ -342,7 +343,7 @@ func GetSystemNetInfo(c *gin.Context) {
func GetSystemProxy(c *gin.Context) {
url := c.Query("url")
resp, err := http.Get(url)
resp, err := http2.Get(url, 30*time.Second)
if err != nil {
return
}