Skip to content

Commit

Permalink
Merge branch 'remove-trailing-slashes' into 'master'
Browse files Browse the repository at this point in the history
Remove trailing slashes from gitlab_url

They do not play nice with gitlab-workhorse (or rather Golang net/http
DefaultServemux).

See merge request !35
  • Loading branch information
Douwe Maan committed Dec 14, 2015
2 parents 785484d + 7fb2d88 commit 962f7a3
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
@@ -1,3 +1,6 @@
v2.6.9
- Remove trailing slashes from gitlab_url

v2.6.8
- Revert git-lfs-authenticate command from white list

Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
2.6.8
2.6.9
10 changes: 5 additions & 5 deletions config.yml.example
Expand Up @@ -6,14 +6,14 @@
# GitLab user. git by default
user: git

# Url to gitlab instance. Used for api calls. Should end with a slash.
# Default: http://localhost:8080/
# Url to gitlab instance. Used for api calls.
# Default: http://localhost:8080
# You only have to change the default if you have configured Unicorn
# to listen on a custom port, or if you have configured Unicorn to
# only listen on a Unix domain socket. For Unix domain sockets use
# "http+unix://<urlquoted-path-to-socket>/", e.g.
# "http+unix://%2Fpath%2Fto%2Fsocket/"
gitlab_url: "http://localhost:8080/"
# "http+unix://<urlquoted-path-to-socket>", e.g.
# "http+unix://%2Fpath%2Fto%2Fsocket"
gitlab_url: "http://localhost:8080"

# See installation.md#using-https for additional HTTPS configuration details.
http_settings:
Expand Down
2 changes: 1 addition & 1 deletion lib/gitlab_config.rb
Expand Up @@ -24,7 +24,7 @@ def secret_file
end

def gitlab_url
@config['gitlab_url'] ||= "http://localhost/"
(@config['gitlab_url'] ||= "http://localhost:8080").sub(%r{/*$}, '')
end

def http_settings
Expand Down
6 changes: 6 additions & 0 deletions spec/gitlab_config_spec.rb
Expand Up @@ -35,6 +35,12 @@

it { should_not be_empty }
it { should eq(url) }

context 'remove trailing slashes' do
before { config.send(:config)['gitlab_url'] = url + '//' }

it { should eq(url) }
end
end

describe :audit_usernames do
Expand Down

0 comments on commit 962f7a3

Please sign in to comment.