From eab7842424562c87814a43a12e42964464af630a Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Fri, 12 May 2023 20:32:57 -0700 Subject: [PATCH] add a timeout to http client --- backend/servermanager.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/servermanager.go b/backend/servermanager.go index 8df6ca1..eb9f1b3 100644 --- a/backend/servermanager.go +++ b/backend/servermanager.go @@ -71,14 +71,14 @@ func (s *ServerManager) testConnectionAndCreateClient(connection ServerConnectio func (s *ServerManager) connect(connection ServerConnection, password string) (*subsonic.Client, error) { cli := &subsonic.Client{ - Client: &http.Client{}, + Client: &http.Client{Timeout: 10 * time.Second}, BaseUrl: connection.Hostname, User: connection.Username, PasswordAuth: connection.LegacyAuth, ClientName: "supersonic", } altCli := &subsonic.Client{ - Client: &http.Client{}, + Client: &http.Client{Timeout: 10 * time.Second}, BaseUrl: connection.AltHostname, User: connection.Username, PasswordAuth: connection.LegacyAuth,