Skip to content

Fix caption image loading in Cloudflare runtime - #40

Merged
sarthakagrawal927 merged 1 commit into
mainfrom
agent/meme-lab-caption-runtime-fix-20261005
Oct 5, 2026
Merged

sarthakagrawal927 merged 1 commit into
mainfrom
agent/meme-lab-caption-runtime-fix-20261005

Conversation

@sarthakagrawal927

Copy link
Copy Markdown
Member

Production caption creation returned valid drafts but every source image failed with 502 because Workerd rejects Fetch’s redirect: "error" option. Node fixture tests accepted the option and missed the runtime mismatch.

Use manual redirect mode and reject non-success responses before reading bytes. Redirect targets remain unfetched, and the existing catalogue allowlist, raster signatures and size bounds remain enforced. Add a regression that executes the actual composition handler in Workerd using Wrangler’s existing dev tooling, plus privacy-safe media failure stages in operational logs.

Validation: focused composition and Workerd tests pass (22 tests), including real-runtime JPEG loading and redirect rejection. No new dependencies or production configuration changes. The Anna 1.3.0 bundle is unaffected; both variants use this shared production media endpoint.

@sarthakagrawal927
sarthakagrawal927 merged commit 3ca2ee0 into main Oct 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant