Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

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

fix: return PNG for img-tag embeds on logo/pals endpoint

When <img> tags request pals.aesthetic.computer, the Accept header
prefers image/* — detect this and return raw PNG instead of HTML.
Also adds explicit CORS headers on the PNG response for cross-origin
embedding (Auth0 login pages, etc.).

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

+6 -1
+6 -1
system/netlify/functions/logo.js
··· 40 40 userAgent.includes("python-requests") || 41 41 userAgent.includes("node-fetch"); 42 42 const isPngEndpoint = event.path.split("/").pop() === "logo.png"; 43 + // Return raw PNG when embedded via <img> tags (Accept header prefers images) 44 + const accept = event.headers["accept"] || ""; 45 + const wantsImage = accept.startsWith("image/") || (accept.includes("image/*") && !accept.includes("text/html")); 43 46 44 - if (isServer || isPngEndpoint) { 47 + if (isServer || isPngEndpoint || wantsImage) { 45 48 return { 46 49 statusCode: 200, 47 50 headers: { 48 51 "Content-Type": "image/png", 52 + "Access-Control-Allow-Origin": "*", 53 + "Cache-Control": "no-cache", 49 54 }, 50 55 body: base64Logo, 51 56 isBase64Encoded: true,