diff options
author | Stan Hu <stanhu@gmail.com> | 2016-03-12 18:50:02 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2016-03-12 18:50:02 +0300 |
commit | bb206f947fd66460c09f464e3667b80ca14086d6 (patch) | |
tree | 0fec677746024911df3437ecfe928bef81f0a8dc /lib | |
parent | 2563213ccf3c1b26d58292570f9170f73034b221 (diff) |
Simplify code
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/middleware/go.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/gitlab/middleware/go.rb b/lib/gitlab/middleware/go.rb index bc9bee7cbb6..44d378642a1 100644 --- a/lib/gitlab/middleware/go.rb +++ b/lib/gitlab/middleware/go.rb @@ -26,11 +26,11 @@ module Gitlab end def go_request?(request) - return request["go-get"].to_i == 1 + request["go-get"].to_i == 1 end def go_body(request) - base_url = Settings.gitlab['url'] + base_url = Gitlab.config.gitlab.url # Go subpackages may be in the form of namespace/project/path1/path2/../pathN # We can just ignore the paths and leave the namespace/project path_info = request.env["PATH_INFO"] @@ -43,8 +43,7 @@ module Gitlab end def strip_url(url) - url.gsub('http://', ''). - gsub('https://', '') + url.gsub(/\Ahttps?:\/\//, '') end end end |