@inferencesh/ui 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/og/image.ts +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inferencesh/ui",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "inference.sh's shared UI: the shadcn components (CLI-owned, base-nova on Base UI), our components on top of them, the markdown and docs renderers, OG cards and the theme. Shipped as TypeScript source; the consumer's bundler and Tailwind compile it.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://inference.sh",
package/src/og/image.ts CHANGED
@@ -278,7 +278,9 @@ export async function fetchOgImage(
278
278
  const controller = new AbortController()
279
279
  const timer = setTimeout(() => controller.abort(), opts.timeoutMs ?? OG_IMAGE_LIMITS.timeoutMs)
280
280
  try {
281
- const res = await fetch(checked.url, { redirect: 'error', signal: controller.signal })
281
+ // 'manual': a 3xx comes back as itself (or as an opaqueredirect) and is
282
+ // refused below. Cloudflare Workers reject redirect: 'error'.
283
+ const res = await fetch(checked.url, { redirect: 'manual', signal: controller.signal })
282
284
  if (res.type === 'opaqueredirect' || (res.status >= 300 && res.status < 400)) {
283
285
  throw new OgImageRejected(`redirect ${res.status}`)
284
286
  }