aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/main.go b/main.go
index d606674..c3e436f 100644
--- a/main.go
+++ b/main.go
@@ -2642,7 +2642,18 @@ func RouteImages(w http.ResponseWriter, media string) {
resp, err := http.DefaultClient.Do(req)
- CheckError(err, "error with Route Images resp")
+ if err != nil {
+ fmt.Println("error with Route Images resp " + MediaHashs[media])
+ }
+
+ if err != nil || resp.StatusCode == 404 {
+ fileBytes, err := ioutil.ReadFile("./static/notfound.png")
+
+ CheckError(err, "could not get /static/notfound.png file bytes")
+
+ w.Write(fileBytes)
+ return
+ }
defer resp.Body.Close()