Skip to content

Commit

Permalink
Make all default return of photo URLs to be empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
rwangsc18 committed Oct 29, 2023
1 parent 3eb3b61 commit 224c48b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions iowrappers/photos_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,17 @@ func (photoClient *PhotoHttpClient) GetPhotoURL(photoRef string) PhotoURL {
res, err := photoClient.client.Get(reqURL)
if err != nil {
Logger.Fatal(err)
return photoURL
return ""
}
body, err := io.ReadAll(res.Body)
res.Body.Close()
if res.StatusCode != 302 {
Logger.Warnf("status code should be 302, but is %d", res.StatusCode)
return ""
}
if err != nil {
Logger.Fatal(err)
return photoURL
return ""
}

photoURL, err = parseHTML(body, isHtmlAnchor, isValidPhotoUrl)
Expand Down

0 comments on commit 224c48b

Please sign in to comment.