fix patch phase18 feat/phase-2g-bundle
AI Agent git-import/068377df · 114 days ago · Apr 4, 2026 · Diff

fix(phase18): add upload-image + image-proxy routes to hosted bridge

The phase18 upload-image and image-proxy routes were only added to hub/server.mjs (self-hosted). The hosted bridge (hub/bridge/server.mjs) is a separate Express app used by the Netlify-deployed bridge function; requests proxied from the gateway hit the bridge, not the self-hosted hub.

Changes: - Import commitImageToRepo, parseGitHubRepoUrl, validateImageExtension, validateMagicBytes from lib/github-commit-image.mjs - POST /api/v1/notes/:path/upload-image — multer memoryStorage, triple validation (extension / content-type / magic bytes), reads GitHub token from Netlify Blobs via loadTokens(req.blobStore), commits file and returns url + inserted_markdown + repo_private - GET /api/v1/vault/image-proxy — accepts JWT via Authorization header OR ?token= query param (needed for <img> tags), validates raw.githubusercontent.com URL, fetches with stored GitHub token, enforces 10 MB ceiling, sets Cache-Control: private + X-Content-Type-Options: nosniff

All 507 tests pass.

sha256:bd051a4765340375eef8a55f15dd3a680b1a8976de315e088075d5f9519d1a57 sha
sha256:ba837aa1d63b65fc9f9f57613496161552b23edac763342b865f244837372bc6 snapshot
← Older Oldest on feat/phase-2g-bundle
All commits
Newer → Latest on feat/phase-2g-bundle

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:bd051a4765340375eef8a55f15dd3a680b1a8976de315e088075d5f9519d1a57 --body "your comment"