From e6ac6734c2f636d3d063718a95ba1169e299b51f Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Mon, 4 Dec 2017 20:18:45 -0600 Subject: Use relative _path helper URLs in the GitLab UI Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/40825 --- lib/api/entities.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 62ee20bf7de..d96e7f2770f 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -16,10 +16,13 @@ module API class UserBasic < UserSafe expose :state + expose :avatar_url do |user, options| user.avatar_url(only_path: false) end + expose :avatar_path, if: ->(user, options) { options.fetch(:only_path, false) && user.avatar_path } + expose :web_url do |user, options| Gitlab::Routing.url_helpers.user_url(user) end -- cgit v1.2.3