summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-05-31 07:21:13 +0000
committerRémy Coutable <remy@rymai.me>2018-05-31 07:21:13 +0000
commit86550fa1be32e18b526d22fa4d15b8af26a1e978 (patch)
tree3872c89a102201251bf6d6cfb28d9d8188640053
parent5b9edea9f16d57ef82f4a69eacd91c13d068583d (diff)
parent033b44eb614e7ef4e00f3fcbf13b6d5d751ba80b (diff)
downloadgitlab-ce-86550fa1be32e18b526d22fa4d15b8af26a1e978.tar.gz
Merge branch 'dm-relative-url-root-in-development' into 'master'
Fix various bugs related to relative_url_root in development See merge request gitlab-org/gitlab-ce!19213
-rw-r--r--app/views/peek/_bar.html.haml2
-rw-r--r--lib/gitlab/gon_helper.rb2
-rw-r--r--lib/gitlab/webpack/dev_server_middleware.rb5
3 files changed, 7 insertions, 2 deletions
diff --git a/app/views/peek/_bar.html.haml b/app/views/peek/_bar.html.haml
index cb0cccb8f8a..89d3b931f88 100644
--- a/app/views/peek/_bar.html.haml
+++ b/app/views/peek/_bar.html.haml
@@ -2,6 +2,6 @@
#js-peek{ data: { env: Peek.env,
request_id: Peek.request_id,
- peek_url: peek_routes.results_url,
+ peek_url: "#{peek_routes_path}/results",
profile_url: url_for(safe_params.merge(lineprofiler: 'true')) },
class: Peek.env }
diff --git a/lib/gitlab/gon_helper.rb b/lib/gitlab/gon_helper.rb
index 0d31934347f..deaa14c8434 100644
--- a/lib/gitlab/gon_helper.rb
+++ b/lib/gitlab/gon_helper.rb
@@ -11,7 +11,7 @@ module Gitlab
gon.asset_host = ActionController::Base.asset_host
gon.webpack_public_path = webpack_public_path
gon.relative_url_root = Gitlab.config.gitlab.relative_url_root
- gon.shortcuts_path = help_page_path('shortcuts')
+ gon.shortcuts_path = Gitlab::Routing.url_helpers.help_page_path('shortcuts')
gon.user_color_scheme = Gitlab::ColorSchemes.for_user(current_user).css_class
gon.sentry_dsn = Gitlab::CurrentSettings.clientside_sentry_dsn if Gitlab::CurrentSettings.clientside_sentry_enabled
gon.gitlab_url = Gitlab.config.gitlab.url
diff --git a/lib/gitlab/webpack/dev_server_middleware.rb b/lib/gitlab/webpack/dev_server_middleware.rb
index b9a75eaac63..529f7d6a8d6 100644
--- a/lib/gitlab/webpack/dev_server_middleware.rb
+++ b/lib/gitlab/webpack/dev_server_middleware.rb
@@ -15,6 +15,11 @@ module Gitlab
def perform_request(env)
if @proxy_path && env['PATH_INFO'].start_with?("/#{@proxy_path}")
+ if relative_url_root = Rails.application.config.relative_url_root
+ env['SCRIPT_NAME'] = ""
+ env['REQUEST_PATH'].sub!(/\A#{Regexp.escape(relative_url_root)}/, '')
+ end
+
super(env)
else
@app.call(env)