Fix absolute_image_urls for wiki path
requested to merge 448980-fix-wiki-absolute-image-urls into 367628-wiki-huge-payload-sidekiq-exceed-limit
What does this MR do and why?
When a project wiki webhook is triggered with an uploaded image URL inside the description, the sent payload does not contain the proper absolute image URL.
There are 2 issues:
- Conditional to add
uploads_prefix
is not called. It is because uploading in wiki is prefixed byuploads
(instead of/uploads
). TBH, I don't know yet how it historically happened - The uploaded image in wiki has
/-/wikis/
on the URL. We can usewiki_page.wiki.wiki_base_path
to generate that
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Create a project webhook: [Go to your project] > Settings > Webhooks > Add new webhook > tick "Wiki page events"
- Create or edit a project wiki: [Go to your project] > Plan > Wiki
- Upload an image to the description
- Click "Create Page"
- Check the sent payload on your configured server on point 1