From 5929c49aa6fed642af50da5b71fc775b97006766 Mon Sep 17 00:00:00 2001 From: Norbert Kwizera Date: Fri, 30 Jun 2023 10:22:03 +0200 Subject: [PATCH] Support requesting recordings for Twilio with basic auth --- services/ivr/twiml/service.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/ivr/twiml/service.go b/services/ivr/twiml/service.go index 57b8de577..7aa262405 100644 --- a/services/ivr/twiml/service.go +++ b/services/ivr/twiml/service.go @@ -136,7 +136,9 @@ func NewService(httpClient *http.Client, accountSID string, authToken string) iv } func (s *service) DownloadMedia(url string) (*http.Response, error) { - return http.Get(url) + req, _ := http.NewRequest(http.MethodGet, url, nil) + req.SetBasicAuth(s.accountSID, s.authToken) + return http.DefaultClient.Do(req) } func (s *service) CheckStartRequest(r *http.Request) models.CallError {