summaryrefslogtreecommitdiff
path: root/static/html/daily.htm
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-07-14 20:22:14 -0500
committerChristian Cleberg <[email protected]>2026-07-14 20:22:14 -0500
commit8a00f7c55cdbcddcd878c01a79f2db7dc3f080ef (patch)
treefe4c4ef1188986fd3676253048c3014e4de86d07 /static/html/daily.htm
parent0fdc45a668d95d603a9013f90392f6bc966c72f9 (diff)
downloadskunky-art-8a00f7c55cdbcddcd878c01a79f2db7dc3f080ef.tar.gz
skunky-art-8a00f7c55cdbcddcd878c01a79f2db7dc3f080ef.tar.bz2
skunky-art-8a00f7c55cdbcddcd878c01a79f2db7dc3f080ef.zip
fix(api): harden random-art retry loop
Three bugs in Random(): - The retry loop was unbounded. Only the NSFW path incremented attempt, so a run of DeviantArt errors span forever, hammering the API and risking an egress-IP ban. - string(rand.Intn(999)) converts a rune, not a number: string(65) is "A", not "65". Searches were querying garbage. Use strconv.Itoa. - rand.Intn panics on 0, so an empty result set crashed the handler. Skip empty results. The exhausted-retries error now fires when the loop ends rather than falling through to index an empty slice.
Diffstat (limited to 'static/html/daily.htm')
0 files changed, 0 insertions, 0 deletions