diff options
| author | Christian Cleberg <[email protected]> | 2026-08-07 18:47:01 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-08-07 18:49:04 -0500 |
| commit | 9af155d40accef7aac3ffc6eb960d197798ebd1f (patch) | |
| tree | 05f97782b9cd88a0b7761b86fa4008dd9a43b2a7 /app/api.go | |
| parent | ee9fc6db38dbbee7418f8a3be2ce25eaa76f90ec (diff) | |
| download | skunky-art-1.3.9.tar.gz skunky-art-1.3.9.tar.bz2 skunky-art-1.3.9.zip | |
fix: correct inverted media guard in sendMediav1.3.9
sendMedia returned when the assembled URL was non-empty — i.e. for every
deviation that actually has media — so the random-media endpoint served
an empty body and never sent the image. For a media-less deviation it
instead fell through to mediaURL[21:] on an empty string, panicking in
proxy mode. Guard on len == 0 so real media is sent and absent media is
a no-op.
Diffstat (limited to 'app/api.go')
| -rwxr-xr-x | app/api.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -46,7 +46,7 @@ func (a API) Error(description string, status int) { func (a API) sendMedia(d *devianter.Deviation) { mediaURL, name := devianter.UrlFromMedia(d.Media) a.main.SetFilename(name) - if len(mediaURL) != 0 { + if len(mediaURL) == 0 { return } |
