From 0bcfd0adb303f0fcaac40b703deda49f3dd683f4 Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Mon, 15 Oct 2018 11:42:15 +0100 Subject: Fix image webhook rewriting for uploads This rewrote URLs to be absolute URLs. However, for uploads (the most common case), we actually need them to point to not just the GitLab instance, but the project they're from. Thankfully, we can normally get that information from the object we're building the hook for. --- doc/user/project/integrations/webhooks.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'doc/user/project/integrations') diff --git a/doc/user/project/integrations/webhooks.md b/doc/user/project/integrations/webhooks.md index 7d12cd8f7c2..02c18c7cbd7 100644 --- a/doc/user/project/integrations/webhooks.md +++ b/doc/user/project/integrations/webhooks.md @@ -73,8 +73,8 @@ Below are described the supported events. Triggered when you push to the repository except when pushing tags. -> **Note:** When more than 20 commits are pushed at once, the `commits` web hook - attribute will only contain the first 20 for performance reasons. Loading +> **Note:** When more than 20 commits are pushed at once, the `commits` web hook + attribute will only contain the first 20 for performance reasons. Loading detailed commit data is expensive. Note that despite only 20 commits being present in the `commits` attribute, the `total_commits_count` attribute will contain the actual total. @@ -1157,10 +1157,11 @@ its description: ``` It will appear in the webhook body as the below (assuming that GitLab is -installed at gitlab.example.com): +installed at gitlab.example.com, and the project is at +example-group/example-project): ```markdown -![image](https://gitlab.example.com/uploads/$sha/image.png) +![image](https://gitlab.example.com/example-group/example-project/uploads/$sha/image.png) ``` This will not rewrite URLs that already are pointing to HTTP, HTTPS, or -- cgit v1.2.3