Image upload links not generated properly from Markdown
From https://gitlab.zendesk.com/agent/tickets/130786, a customer noticed broken links to images in issue descriptions.
Looking at the generated HTML, the image src is in the format: https://gitlab.com/uploads/xxxxx/image.png
. If we manually prepend the project path there, the URL works and the image exists. If we edit the description, the Markdown shows: ![image](/uploads/xxxx/image.png)
which looks normal.
In our code, the RelativeLinkFilter
translates these upload links and prepends the project / group to the URL. I'm not sure why this is not happening here.
Also, it seems like this is only happening on that customer's project. The customer has several issues that have the same behavior.
The customer also mentioned that this worked before and just recently broke for them.
cc @cynthia
EDIT: probably related to https://gitlab.com/gitlab-org/gitlab-ce/commit/4daf3dc0dba8be985ee7d7e3e331e0468d5a72ad
Reproducer:
- as a maintainer, go to a public project and attach an image to an issue or issue comment
- as a not-member user, to to the issue - you can see the image
- as a maintainer, go to project settings and make its repository acceible only to project members
- as a not-member user go to the issue - image is not rendered there
We should probably use different permission on https://gitlab.com/gitlab-org/gitlab-ce/commit/4daf3dc0dba8be985ee7d7e3e331e0468d5a72ad#582760791f0022903f833fde9d24a0b167ca59ab_169_173 instead of download_code