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.
0 comments
muse hub commit comment sha256:bd051a4765340375eef8a55f15dd3a680b1a8976de315e088075d5f9519d1a57 --body "your comment"
No comments yet. Be the first to start the discussion.