in http-cache-action/proxy/proxy.go [79:97]
func proxyDownloadFromURL(w http.ResponseWriter, url string) {
resp, err := http.Get(url)
if err != nil {
log.Printf("Proxying cache %s failed: %v\n", url, err)
w.WriteHeader(http.StatusInternalServerError)
return
}
successfulStatus := 100 <= resp.StatusCode && resp.StatusCode < 300
if !successfulStatus {
log.Printf("Proxying cache %s failed with %d status\n", url, resp.StatusCode)
w.WriteHeader(resp.StatusCode)
return
}
_, err = io.Copy(w, resp.Body)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
}
w.WriteHeader(http.StatusOK)
}