diff options
Diffstat (limited to 'lib/gitlab/webpack')
-rw-r--r-- | lib/gitlab/webpack/dev_server_middleware.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/gitlab/webpack/dev_server_middleware.rb b/lib/gitlab/webpack/dev_server_middleware.rb index 069e68e8d29..88f2a4455c6 100644 --- a/lib/gitlab/webpack/dev_server_middleware.rb +++ b/lib/gitlab/webpack/dev_server_middleware.rb @@ -16,14 +16,14 @@ module Gitlab super(app, backend: "#{@proxy_scheme}://#{@proxy_host}:#{@proxy_port}", **opts) end - # disable SSL check since any cert used here will likely be self-signed - def rewrite_env(env) - env["rack.ssl_verify_none"] = true - env - end - def perform_request(env) if @proxy_path && env['PATH_INFO'].start_with?("/#{@proxy_path}") + # disable SSL check since any cert used here will likely be self-signed + env['rack.ssl_verify_none'] = true + + # ensure we pass the expected Host header so webpack-dev-server doesn't complain + env['HTTP_HOST'] = "#{@proxy_host}:#{@proxy_port}" + if relative_url_root = Rails.application.config.relative_url_root env['SCRIPT_NAME'] = "" env['REQUEST_PATH'].sub!(/\A#{Regexp.escape(relative_url_root)}/, '') |