Skip to content

fix(server): allow blob attachments in web UI - #40692

Merged
Hona merged 1 commit into
anomalyco:devfrom
rexdotsh:web-blob-csp
Aug 5, 2026
Merged

fix(server): allow blob attachments in web UI#40692
Hona merged 1 commit into
anomalyco:devfrom
rexdotsh:web-blob-csp

Conversation

@rexdotsh

@rexdotsh rexdotsh commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #40691

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Allows blob: URLs in the web UI's img-src and connect-src Content Security Policy directives.

OpenCode 1.18.13 changed attachments to use blob-backed draft storage in #40207. Attachment previews load the object URL as an image, while submission fetches the object URL before converting it into a data URL.

The server CSP allowed data: URLs but not blob: URLs, so browsers blocked both operations with blocked:csp.

This keeps the change limited to the two directives used by the attachment flow and adds regression assertions for both allowances.

How did you verify your code works?

  • cd packages/opencode && bun test test/server/httpapi-ui.test.ts
  • cd packages/opencode && bun typecheck
  • cd packages/opencode && OPENCODE_CHANNEL=latest OPENCODE_VERSION=1.18.13 bun run build --single --skip-install
  • Built a production-channel binary and verified the affected attachment flow through the web UI.
  • git diff --check

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@Hona
Hona enabled auto-merge (squash) August 5, 2026 22:02
@Hona
Hona merged commit 23bbc5c into anomalyco:dev Aug 5, 2026
10 checks passed
DevFlex-AI added a commit to bolt-builder/bolt-cli that referenced this pull request Aug 5, 2026
fix(server): allow blob attachments in web UI (anomalyco#40692)
charlesverge pushed a commit to charlesverge/opencode that referenced this pull request Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web UI CSP blocks blob-backed attachments

2 participants