Skip to content

Use relative paths for group/project/user avatars

What does this MR do?

This MR changes these methods:

  1. Group#avatar_url
  2. Project#avatar_url
  3. User#avatar_url

Instead of using full path for avatars all the time, now we respect asset_host configuration.
It allows to use relative paths if asset_host is set to nil, and load avatars from a standalone assets server if asset_host is set.

Why was this MR needed?

Project avatars are not loaded properly if:

  1. GitLab works behind proxy servers.
  2. a user uses a standalone server to manage assets.

Screenshots (if relevant)Screenshot_20170430_201205

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #13418 (closed) and #19662 (closed)

Merge request reports