Brand Studio docs
Engineering manualAPI route source

/api/brand-studio/proxy-asset

Exact current route handler: hosted-app/app/api/brand-studio/proxy-asset/route.js

Methods: GET. Input signals: query parameters. Literal response-status signals: none detected.

Source: hosted-app/app/api/brand-studio/proxy-asset/route.js. Imports: ../../../../lib/public-raster.mjs, next/server. Exact source is shown for inspection; its presence does not prove authentication, validation or live behavior.

All API routes · API and execution contract

// Public CDN raster proxy. SVG is deliberately not served from the app origin.
export const runtime = "nodejs";
export const dynamic = "force-dynamic";
import { NextResponse } from "next/server";
import { fetchPublicRaster } from "../../../../lib/public-raster.mjs";
export async function GET(request) {
  try {
    const result = await fetchPublicRaster(new URL(request.url).searchParams.get("url") || "", { signal: request.signal });
    return new NextResponse(result.bytes, { headers: {
      "content-type": result.contentType, "content-length": String(result.bytes.length),
      "x-content-type-options": "nosniff", "content-security-policy": "default-src 'none'; sandbox",
      "cache-control": "public, max-age=3600", "referrer-policy": "no-referrer"
    } });
  } catch (error) {
    return NextResponse.json({ status: "unavailable", reason: error?.code || "asset_fetch_failed" },
      { status: error?.httpStatus || 502, headers: { "cache-control": "no-store" } });
  }
}