Repository navigation
media: download images whose DOWNLOAD_URL is a full URL - #286
Merged
Merged
Conversation
|
All clear! No issues remaining. 🎉 2 issues already resolved
All CI checks passed on
Select any unchecked box below to run or rerun that agent. Full resultsIndent Review Agent
|
highesttt
previously approved these changes
Oct 26, 2026
highesttt
left a comment
Collaborator
There was a problem hiding this comment.
Looks good; just one thing
- Oversized images are dropped without the 100MB notice, then would be backfilled upon restart. there should probably be better error handling here
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some inbound LINE images never show up in Beeper. The message carries a
DOWNLOAD_URLthat's a full URL, butDownloadOBSPublicResourceonly accepts a path on the OBS host. The download fails and the whole message is skipped:One cloud account hit this for 71 images in a day. LINE Chrome accepts both forms: if
new URL(DOWNLOAD_URL)parses, it fetches it as-is; otherwise it prefixes the OBS base. Either way it sends no LINE auth headers.The bridge now does the same. Because the URL comes from message metadata, full URLs go through the public-only transport the Viber and WeChat bridges use for sender-supplied URLs: http/https only, every resolved address must be public and gets pinned, and at most 3 redirects, each one re-checked. Those downloads are also capped at Beeper's 100 MB file limit and 45 s, the same timeout Viber uses for media. Relative paths work as before.
DOWNLOAD_URLis a full URLDOWNLOAD_URLis a/r/...pathBefore / after (local, macOS)
Before:
main(9be42f2). After:625183f(this branch, already up to date with main). Each build ran a throwaway, uncommitted Go test inpkg/linethat callsDownloadOBSPublicResourcedirectly. No LINE account was involved, so this covers the download, not a full inbound message.DOWNLOAD_URLpublic OBS resource must be an absolute pathhttp://169.254.169.254/...unsupported LINE public media URLhttp://127.0.0.1:<port>/image(local server)unsupported LINE public media URLhttp://127.0.0.1//r/...pathLINE OBS object not foundTag
@indentto continue the conversation here.