Commit bb206f94 authored by Stan Hu's avatar Stan Hu

Simplify code

parent 2563213c
...@@ -26,11 +26,11 @@ module Gitlab ...@@ -26,11 +26,11 @@ module Gitlab
end end
def go_request?(request) def go_request?(request)
return request["go-get"].to_i == 1 request["go-get"].to_i == 1
end end
def go_body(request) 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 # Go subpackages may be in the form of namespace/project/path1/path2/../pathN
# We can just ignore the paths and leave the namespace/project # We can just ignore the paths and leave the namespace/project
path_info = request.env["PATH_INFO"] path_info = request.env["PATH_INFO"]
...@@ -43,8 +43,7 @@ module Gitlab ...@@ -43,8 +43,7 @@ module Gitlab
end end
def strip_url(url) def strip_url(url)
url.gsub('http://', ''). url.gsub(/\Ahttps?:\/\//, '')
gsub('https://', '')
end end
end end
end end
......
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