diff options
-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 |