From 5916aca8213fa5d8e1592f289bd34ef50bc443ac Mon Sep 17 00:00:00 2001 From: Gaven Henry Date: Sun, 9 Oct 2022 19:00:51 +0200 Subject: [PATCH] Fix missing application of user-agent setting One place where the user-agent setting was not applied, resulting in some podcasts failing to download still. Creating a PR to highlight that this was missed as it is only mentioned in a comment on the previous PR. credit to @wiseindy https://github.com/wiseindy/podgrab --- service/podcastService.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/service/podcastService.go b/service/podcastService.go index ac91a5e..0cba91e 100644 --- a/service/podcastService.go +++ b/service/podcastService.go @@ -715,6 +715,11 @@ func makeQuery(url string) ([]byte, error) { if err != nil { return nil, err } + + setting := db.GetOrCreateSetting() + if len(setting.UserAgent) > 0 { + req.Header.Add("User-Agent", setting.UserAgent) + } resp, err := http.DefaultClient.Do(req) if err != nil {