Commit 962f7a31 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'remove-trailing-slashes' into 'master'

Remove trailing slashes from gitlab_url

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

See merge request !35
parents 785484d2 7fb2d884
Pipeline #204 failed with stage
v2.6.9
- Remove trailing slashes from gitlab_url
v2.6.8 v2.6.8
- Revert git-lfs-authenticate command from white list - Revert git-lfs-authenticate command from white list
......
...@@ -6,14 +6,14 @@ ...@@ -6,14 +6,14 @@
# GitLab user. git by default # GitLab user. git by default
user: git user: git
# Url to gitlab instance. Used for api calls. Should end with a slash. # Url to gitlab instance. Used for api calls.
# Default: http://localhost:8080/ # Default: http://localhost:8080
# You only have to change the default if you have configured Unicorn # 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 # 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 # only listen on a Unix domain socket. For Unix domain sockets use
# "http+unix://<urlquoted-path-to-socket>/", e.g. # "http+unix://<urlquoted-path-to-socket>", e.g.
# "http+unix://%2Fpath%2Fto%2Fsocket/" # "http+unix://%2Fpath%2Fto%2Fsocket"
gitlab_url: "http://localhost:8080/" gitlab_url: "http://localhost:8080"
# See installation.md#using-https for additional HTTPS configuration details. # See installation.md#using-https for additional HTTPS configuration details.
http_settings: http_settings:
......
...@@ -24,7 +24,7 @@ class GitlabConfig ...@@ -24,7 +24,7 @@ class GitlabConfig
end end
def gitlab_url def gitlab_url
@config['gitlab_url'] ||= "http://localhost/" (@config['gitlab_url'] ||= "http://localhost:8080").sub(%r{/*$}, '')
end end
def http_settings def http_settings
......
...@@ -35,6 +35,12 @@ eos ...@@ -35,6 +35,12 @@ eos
it { should_not be_empty } it { should_not be_empty }
it { should eq(url) } it { should eq(url) }
context 'remove trailing slashes' do
before { config.send(:config)['gitlab_url'] = url + '//' }
it { should eq(url) }
end
end end
describe :audit_usernames do describe :audit_usernames do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment