Make it so you can use ?raw=true on /api/berrydash/icon-marketplace/icon for it to act as a .png file

This commit is contained in:
2026-02-02 18:50:17 -07:00
parent 48060397f4
commit 14b6522af8
2 changed files with 13 additions and 0 deletions

View File

@@ -74,6 +74,13 @@ export async function handler (context: Context) {
)
}
if (context.query.raw) {
const buffer = Buffer.from(icon[0].data, 'base64')
return new Response(buffer, {
headers: { 'Content-Type': 'image/png' }
})
}
const userData = await db0
.select({ username: users.username })
.from(users)