diff options
author | Sean McGivern <sean@gitlab.com> | 2018-07-06 13:35:30 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-07-06 13:35:30 +0300 |
commit | 0d9ef34a2541a2adf00677132eac3637de33b6d4 (patch) | |
tree | 3fd6cc6aeffc6d33b5e28d1d054a26cdf15e50e5 /doc/user | |
parent | 7ff24772b63691f857a1ee1d113dcbdc3b01f064 (diff) |
Add documentation and specs for webhook URL rewriting
Diffstat (limited to 'doc/user')
-rw-r--r-- | doc/user/project/integrations/webhooks.md | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/user/project/integrations/webhooks.md b/doc/user/project/integrations/webhooks.md index 19df78f4140..5f33e0c1dc6 100644 --- a/doc/user/project/integrations/webhooks.md +++ b/doc/user/project/integrations/webhooks.md @@ -6,6 +6,13 @@ Starting from GitLab 8.5: - the `project.ssh_url` key is deprecated in favor of the `project.git_ssh_url` key - the `project.http_url` key is deprecated in favor of the `project.git_http_url` key +>**Note** +Starting from GitLab 11.2: +- The `description` field for issues, merge requests, comments, and wiki pages + is rewritten so that simple Markdown image references (like + `![](/uploads/...)`) have their target URL changed to an absolute URL. See + [image URL rewriting](#image-url-rewriting) for more details. + Project webhooks allow you to trigger a URL if for example new code is pushed or a new issue is created. You can configure webhooks to listen for specific events like pushes, issues or merge requests. GitLab will send a POST request with data @@ -1121,6 +1128,27 @@ X-Gitlab-Event: Build Hook } ``` +## Image URL rewriting + +From GitLab 11.2, simple image references are rewritten to use an absolute URL +in webhooks. So if an image, merge request, comment, or wiki page has this in +its description: + +```markdown +![image](/uploads/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/image.png) +``` + +It will appear in the webhook body as the below (assuming that GitLab is +installed at gitlab.example.com): + +```markdown +![image](https://gitlab.example.com/uploads/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/image.png) +``` + +This will not rewrite URLs that already are pointing to HTTP, HTTPS, or +protocol-relative URLs. It will also not rewrite image URLs using advanced +Markdown features, like link labels. + ## Testing webhooks You can trigger the webhook manually. Sample data from the project will be used.Sample data will take from the project. |