Skip to content

Commit

Permalink
Merge pull request #21 from mkyutani/thumnailmissing
Browse files Browse the repository at this point in the history
Post a message successfully even if bsky fails to get thumbnail of link card
  • Loading branch information
mattn authored Feb 25, 2024
2 parents 0e17b5f + 8e777b3 commit bb239e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion timeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func addLink(xrpcc *xrpc.Client, post *bsky.FeedPost, link string) {
}
if imgURL != "" && post.Embed.EmbedExternal != nil {
resp, err := http.Get(imgURL)
if err == nil {
if err == nil && resp.StatusCode == http.StatusOK {
defer resp.Body.Close()
b, err := io.ReadAll(resp.Body)
if err == nil {
Expand Down

0 comments on commit bb239e6

Please sign in to comment.