Show inline images on GitHub #87
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
On GitHub, images in PR and issue bodies always show as
🖼 altlinks, because the adapter can't open them. Parent: #83. Depends on #84; pick this up after #84 merges.Acceptance criteria
Plan
Check first: GitHub serves pasted images as
https://github.com/user-attachments/assets/<id>, which redirect to signed*.githubusercontent.comURLs. Confirm withcurl -sIand a token whether a private repo's asset opens with the API token. If it doesn't, comment the finding here and implement the public-repo case only. If no case works, close this ticket as won't-do with the evidence, which matches design.md's "everywhere else, stays a link".If it works: implement
forge.AssetReaderon the GitHub adapter, mirroringinternal/forge/gitea/assets.go. Same-origin check against the web root (github.com, not api.github.com), dropAuthorizationon any off-origin hop, and redact query strings in errors. GitHub's drag-and-drop inserts an HTML<img>tag, which design.md already says stays a link. Only Markdown![]()images draw.Context
ADR 0016 (inline images).
internal/forge/gitea/assets.go,internal/forge/origin.go(SameOrigin),forge.ActAssetsincan.go.Out of scope
Rendering HTML
<img>tags (design.md keeps those as links).🤖 Check done (2026-10-09). Public repo:
https://github.com/user-attachments/assets/<id>answers 302 to a signedgithub-production-user-asset-*.s3.amazonaws.comURL, with or without a token, and following it gives 200 with the file. Private repo: no private repo on the test account has an attachment, so it couldn't be tested live. GitHub is widely reported to serve private-repo attachments only to a browser session, not to API tokens. Per the plan, this ticket implements the public case: the same-origin check against the web root (github.com) and the token dropped on the S3 hop. A private-repo image that 404s stays a link, as design.md → Images already says for a failed load.🤖 merged: #91