Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: avoid duplicate user prefix in /media/paintings redirect

get-painting returns painting.slug that is already fully qualified
(\"auth0|.../painting/<timestamp>\"), so unconditionally prepending
painting.user produced keys like \"auth0|.../auth0|.../painting/TS.png\"
and the Spaces bucket 403'd. Guard the prepend so it only fires when
the slug is a bare one.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+5 -1
+5 -1
lith/server.mjs
··· 831 831 const painting = JSON.parse(result.body); 832 832 const bucket = painting.user ? "user-aesthetic-computer" : "art-aesthetic-computer"; 833 833 const slug = painting.slug?.split(":")[0] || painting.slug; 834 - const key = painting.user ? `${painting.user}/${slug}.png` : `${slug}.png`; 834 + // Slug may already be fully-qualified (e.g. "auth0|.../painting/TS"). 835 + // Only prepend user when it's a bare slug, otherwise we double the prefix. 836 + const key = painting.user && !slug.startsWith(`${painting.user}/`) 837 + ? `${painting.user}/${slug}.png` 838 + : `${slug}.png`; 835 839 return res.redirect(302, `https://${bucket}.sfo3.digitaloceanspaces.com/${key}`); 836 840 } 837 841 } catch {}