Avatar url in profile view is incorrect when using non-default port
I've deployed gitlab (using docker, if it matter), and it's listening on port 4000. When looking at the profile page, after uploading an avatar and refreshing the page, the avatar url is incorrect. It points to the correct location and host, however the port is missing.
There are two solutions to this:
- Fix the URL (either gitlab_config.url or the avatar url) by adding the port to it
- Make the avatar url without the host (still absolute path) - I see no reason why not use this approach.
Personally the latter was easier to do, so I've changed the file and it's working for me. I don't see any reason why to not simple make the path without the gitlab url. I've only changed the user.rb file on my deployment (hence I've tested it), but I've noticed the same pattern appears in the other files as well:
- https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/models/group.rb#L94
- https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/models/project.rb#L705
- https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/models/user.rb#L657
p.s. Link to old issue in github (I hope it's okay to link to github issues; if not, feel free to remove it or say so and I'll remove it): https://github.com/gitlabhq/gitlabhq/issues/7270