I'm trying to figure out whether I've got something configured wrong or I'm hitting a bug in the media proxy implementation. I've got a note I want to post that includes a link. I'm making it as a test post for mentioned actors only (of which there are none). I put the link in the markdown, post saves, no problem there...but at the bottom of the note it's adding a div.activity-og-meta containing a link to https://127.0.0.1:12658/<path component of the link>
and, in front of that, what appears to be a broken attempt to proxy https://127.0.0.1:12658/logo-512.png
. The proxied media request is raising a 500 error "Exception in ASGI Application" that ultimately appears to be coming from url.py
raising an InvalidURLError when serve_proxy_media
calls check_url
because it says "https://127.0.0.1:12658/logo-512.png" is invalid (due to being recognized as a local address, I think, and that much seems entirely reasonable), but I haven't gotten as far as figuring out how it came up with something at 127.0.0.1 as what it wants to proxy in the first place (and I wasn't really expecting it to try to proxy anything about a link to a page about a unicode code point, either). I'm afraid it may end up being something screwy about my hosting setup, but I thought I'd start with this much and see if it's a recognizable problem already.
Hey, can you share the content of the post to see if I am able to reproduce it?
Thanks!
...Okay, I should have tested this more thoroughly. 🤦
It seems that it only behaves exactly this way (so far) if I try to use this:
[㬋](https://unicode.link/codepoint/3B0B-cjk-name-of-a-star)
I was thrown off because I had previously tried to use this:
[㬋](https://codepoints.net/U+3B0B)
...which does not result in the URLs being rewritten so that they attempt to phone home, but does seem to try to proxy
https://codepoints.net/api/v1/glyph/3B0B
and displays a broken image. I remember trying the first URL as a replacement; I thought I remembered verifying that the rest of the behavior was similar, but it was late, and I must have thought about it but not done it. Sorry about that.
Thank you for the content.
I took a look at
https://unicode.link/codepoint/3B0B-cjk-name-of-a-star
and it does advertise itself as127.0.0.1:12658
in its opengraph metadata:<meta property="og:url" content="https://127.0.0.1:12658/codepoint/3B0B-cjk-name-of-a-star" data-svelte="svelte-1avh4in">
.I will push a fix that will check if the URL returned in the opengraph metadata are valid, and if they're not, just skip them. Out of curiosity, I checked Mastodon and it does skpi the opengraph metadata too for this URL.
Thank you for reporting this! I will you let you know once a a fix is pushed.
I just pushed a fix: https://git.sr.ht/~tsileo/microblog.pub/commit/22410862f3d2cab24a5888f0c7245d63f107c3d7
Thanks!