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

@ -39,7 +39,7 @@ func imageProxy(l *utils.Logger) http.HandlerFunc {
// first segment of URL resize the image to reduce bandwith usage.
url := fmt.Sprintf("https://t2.genius.com/unsafe/300x300/https://images.genius.com/%s.%s", f, ext)
res, err := sendRequest(url)
res, err := utils.SendRequest(url)
if err != nil {
l.Error(err.Error())
w.WriteHeader(http.StatusInternalServerError)