We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 594c9fd commit 745473cCopy full SHA for 745473c
1 file changed
core/http/endpoints/localai/video.go
@@ -22,12 +22,19 @@ import (
22
"github.com/mudler/LocalAI/core/backend"
23
24
model "github.com/mudler/LocalAI/pkg/model"
25
+ "github.com/mudler/LocalAI/pkg/utils"
26
"github.com/mudler/xlog"
27
)
28
29
+var videoDownloadClient = http.Client{Timeout: 30 * time.Second}
30
+
31
func downloadFile(url string) (string, error) {
32
+ if err := utils.ValidateExternalURL(url); err != nil {
33
+ return "", fmt.Errorf("URL validation failed: %w", err)
34
+ }
35
36
// Get the data
- resp, err := http.Get(url)
37
+ resp, err := videoDownloadClient.Get(url)
38
if err != nil {
39
return "", err
40
}
0 commit comments