Describe the enhancement
Currently, the /api/logo endpoint returns a 200 OK status with a Content-Type: application/json payload containing the signed CloudFront URL for the requested logo.
Example Current Response:
// GET /api/logo?key=google.com&API_KEY=...
{
"statusCode": 200,
"data": "https://d30qwik574etgt.cloudfront.net/png/GOOGLE.png?..."
}
While this works for client-side JavaScript applications that parse the JSON and then mount the image, it prevents users from using the API directly in HTML. When a browser encounters <img src="https://api-stage.openlogo.fyi/api/logo...">, it expects a binary image file or a redirect to one. Instead, it receives JSON text, fails to parse it as an image, and renders a broken image icon.
Expected Behavior
Developers should be able to drop the API URL directly into standard HTML tags, Markdown files, or email templates like this:
<img src="https://api-stage.openlogo.fyi/api/logo?key=google.com&API_KEY=YOUR_KEY" alt="Google Logo" />
Task / Proposed Solution
Update the API endpoint controller so that instead of returning a JSON response, it issues an HTTP Redirect to the generated CDN URL.
Implementation Steps:
- Locate the endpoint controller handling
/api/logo.
- Instead of returning the URL in a JSON payload (
res.status(200).json(...)), update the response to send an HTTP 302 (Found) or HTTP 307 (Temporary Redirect) status code.
- Set the
Location header of the response to the generated CloudFront CDN URL.
(Note: If using Next.js/Vercel, you can typically use res.redirect(307, cdnUrl)).
- Ensure error states (e.g., missing API key, rate limits, logo not found) still return appropriate standard JSON/text HTTP error codes (400, 401, 404, 429).
Acceptance Criteria
Why should this enhancement be implemented? Add additional informaiton.
No response
Confirmation
Describe the enhancement
Currently, the
/api/logoendpoint returns a200 OKstatus with aContent-Type: application/jsonpayload containing the signed CloudFront URL for the requested logo.Example Current Response:
While this works for client-side JavaScript applications that parse the JSON and then mount the image, it prevents users from using the API directly in HTML. When a browser encounters
<img src="https://api-stage.openlogo.fyi/api/logo...">, it expects a binary image file or a redirect to one. Instead, it receives JSON text, fails to parse it as an image, and renders a broken image icon.Expected Behavior
Developers should be able to drop the API URL directly into standard HTML tags, Markdown files, or email templates like this:
Task / Proposed Solution
Update the API endpoint controller so that instead of returning a JSON response, it issues an HTTP Redirect to the generated CDN URL.
Implementation Steps:
/api/logo.res.status(200).json(...)), update the response to send an HTTP 302 (Found) or HTTP 307 (Temporary Redirect) status code.Locationheader of the response to the generated CloudFront CDN URL.(Note: If using Next.js/Vercel, you can typically use
res.redirect(307, cdnUrl)).Acceptance Criteria
GETrequest to/api/logowith valid parameters returns an HTTP302or307status.Locationheader pointing to the validd30qwik574etgt.cloudfront.netURL.<img src="...">tag in a plain HTML file and successfully renders the image in a browser.Why should this enhancement be implemented? Add additional informaiton.
No response
Confirmation