diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-12-14 11:38:08 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-12-14 11:38:08 +0000 |
commit | 962f7a312623e8ab34efeaf098701c89e633b68c (patch) | |
tree | b743290e5120b9e6923d084768995cad8f6ef306 | |
parent | 785484d2ae5af1254fbb3baa2775acc930e85d88 (diff) | |
parent | 7fb2d88454e703d1a4d51e87a9276b3e0ef4809d (diff) | |
download | gitlab-shell-962f7a312623e8ab34efeaf098701c89e633b68c.tar.gz |
Merge branch 'remove-trailing-slashes' into 'master'
v2.6.9
Remove trailing slashes from gitlab_url
They do not play nice with gitlab-workhorse (or rather Golang net/http
DefaultServemux).
See merge request !35
-rw-r--r-- | CHANGELOG | 3 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | config.yml.example | 10 | ||||
-rw-r--r-- | lib/gitlab_config.rb | 2 | ||||
-rw-r--r-- | spec/gitlab_config_spec.rb | 6 |
5 files changed, 16 insertions, 7 deletions
@@ -1,3 +1,6 @@ +v2.6.9 + - Remove trailing slashes from gitlab_url + v2.6.8 - Revert git-lfs-authenticate command from white list @@ -1 +1 @@ -2.6.8 +2.6.9 diff --git a/config.yml.example b/config.yml.example index e7ecc01..a7e8d8a 100644 --- a/config.yml.example +++ b/config.yml.example @@ -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: diff --git a/lib/gitlab_config.rb b/lib/gitlab_config.rb index caca176..831f0e3 100644 --- a/lib/gitlab_config.rb +++ b/lib/gitlab_config.rb @@ -24,7 +24,7 @@ class GitlabConfig end def gitlab_url - @config['gitlab_url'] ||= "http://localhost/" + (@config['gitlab_url'] ||= "http://localhost:8080").sub(%r{/*$}, '') end def http_settings diff --git a/spec/gitlab_config_spec.rb b/spec/gitlab_config_spec.rb index 52fb182..0ce641b 100644 --- a/spec/gitlab_config_spec.rb +++ b/spec/gitlab_config_spec.rb @@ -35,6 +35,12 @@ eos 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 |