user_avatar URL in push event webhook JSON payload is relative, should be absolute
Summary
Webhook payload of push event (and probably others) sets user_avatar
value to a relative URL instead of the absolute URL it used to. This breaks display of user avatars for webhook integrations like in Rocket.Chat (and probably others) because the receiving webhook endpoint can not find the avatar at the specified URI/path relative to its own web address.
Only happens for avatars set in Gitlab itself, not Gravatars. Since Gitlab 9.3.0 (using CE and Omnibus install), worked correctly in 9.2.5 (definitely) and 9.2.7 (very probably).
Steps to reproduce
Send a test push event from any project to a specified webhook URL as a user that has an avatar set in Gitlab (not Gravatar) and observe the JSON payload that arrives at the webhook endpoint.
What is the current bug behavior?
JSON payload content looks like this (see user_avatar
value):
{
"object_kind":"push",
"event_name":"push",
"before":"abc",
"after":"def",
"ref":"refs/heads/master",
"checkout_sha":"xyc",
"message":null,
"user_id":2,
"user_name":"Andreas Ntaflos",
"user_username":"daff",
"user_email":"andreas.ntaflos@example.com",
"user_avatar":"/uploads/system/user/avatar/2/avatar.png",
"project_id": ...
}
What is the expected correct behavior?
JSON payload should look like this (see user_avatar
value):
{
"object_kind":"push",
"event_name":"push",
"before":"abc",
"after":"def",
"ref":"refs/heads/master",
"checkout_sha":"xyz",
"message":null,
"user_id":2,
"user_name":"Andreas Ntaflos",
"user_username":"daff",
"user_email":"andreas.ntaflos@example.com",
"user_avatar":"https://gitlab.example.com/uploads/system/user/avatar/2/avatar.png",
"project_id": ...
}
Relevant logs and/or screenshots
Using a slightly modified Rocket.Chat integration script for push and other notifications, this is what it currently looks like when a push event webhook is triggered: