提交 8a66a10c 编写于 作者: D Dmitriy Zaporozhets

Merge branch 'fix_avatar_url' into 'master'

Remove unnecessary / from avatar url

## What does this MR do?

This MR removes the unecessary / from the avatar url.

## What Use Case does this MR solve?

The // in the url cold lead to avatars not being displayed (reported on IRC)

With this MR the avatar url changes from
http://localhost:3000//uploads/user/avatar/1/gitlab_logo.png
to
http://localhost:3000/uploads/user/avatar/1/gitlab_logo.png

@dblessing Can you take a look?

See merge request !303
...@@ -497,7 +497,7 @@ class User < ActiveRecord::Base ...@@ -497,7 +497,7 @@ class User < ActiveRecord::Base
def avatar_url(size = nil) def avatar_url(size = nil)
if avatar.present? if avatar.present?
[gitlab_config.url, avatar.url].join("/") [gitlab_config.url, avatar.url].join
else else
GravatarService.new.execute(email, size) GravatarService.new.execute(email, size)
end end
......
...@@ -73,7 +73,7 @@ describe ApplicationHelper do ...@@ -73,7 +73,7 @@ describe ApplicationHelper do
user = create(:user) user = create(:user)
user.avatar = File.open(avatar_file_path) user.avatar = File.open(avatar_file_path)
user.save! user.save!
avatar_icon(user.email).to_s.should match("/gitlab//uploads/user/avatar/#{ user.id }/gitlab_logo.png") avatar_icon(user.email).to_s.should match("/gitlab/uploads/user/avatar/#{ user.id }/gitlab_logo.png")
end end
it "should call gravatar_icon when no avatar is present" do it "should call gravatar_icon when no avatar is present" do
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册