feat: add proxy layer option for requests

Fixes #56 #21
This commit is contained in:
rramiachraf
2024-05-03 12:45:58 +01:00
parent c940b4a2cd
commit 2c0f43b8f7
15 changed files with 78 additions and 450 deletions

View File

@ -26,7 +26,7 @@ func album(l *utils.Logger) http.HandlerFunc {
url := fmt.Sprintf("https://genius.com/albums/%s/%s", artist, albumName)
resp, err := sendRequest(url)
resp, err := utils.SendRequest(url)
if err != nil {
l.Error(err.Error())
w.WriteHeader(http.StatusInternalServerError)
@ -53,7 +53,7 @@ func album(l *utils.Logger) http.HandlerFunc {
cf := doc.Find(".cloudflare_content").Length()
if cf > 0 {
l.Error("cloudflare got in the way")
views.ErrorPage(500, "i'll fix this later #21").Render(context.Background(), w)
views.ErrorPage(500, "cloudflare is detected").Render(context.Background(), w)
return
}