mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-03-20 03:57:02 +08:00
This turned out to be a bit complicated, see https://codeberg.org/forgejo/forgejo/issues/6360#issuecomment-9010932 . Pagure images in comments use root-relative Markdown links, like this:  but Forgejo renders those relative to *the repo*, not the server root, so they get rendered as something like: <img src="/forgejoorg/forgejorepo/group/repo/issue/raw/files/image.png"> However, it does *not* do this for *non-image* root-relative links, so those aren't 'broken'. This means we need to handle *both* cases in the proxying, and we also need to keep in mind that Pagure allows repos without a group. So we can wind up with one, two, three or four folders before /issue. I did some testing and I *think* this should cover all cases. I've tested this does fix images, I haven't tested on a non-image attachment yet (need to find one). Signed-off-by: Adam Williamson <awilliam@redhat.com>