summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-03-12 07:50:02 -0800
committerStan Hu <stanhu@gmail.com>2016-03-12 07:50:02 -0800
commitbb206f947fd66460c09f464e3667b80ca14086d6 (patch)
tree0fec677746024911df3437ecfe928bef81f0a8dc
parent2563213ccf3c1b26d58292570f9170f73034b221 (diff)
downloadgitlab-ce-bb206f947fd66460c09f464e3667b80ca14086d6.tar.gz
Simplify code
-rw-r--r--lib/gitlab/middleware/go.rb7
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