diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-02-27 00:32:50 -0600 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-02-27 00:32:50 -0600 |
commit | 48707bc2aba86ce0384be8d21c80637737b1c17c (patch) | |
tree | fdd5ae575fba1237133baba75c2932d83942308d /lib | |
parent | 83d440760ff4f7594d9814945c07af2274e4e13d (diff) | |
download | gitlab-ce-48707bc2aba86ce0384be8d21c80637737b1c17c.tar.gz |
ensure webpack dev server proxy connects regardless of request headersfix-webpack-dev-server-proxy
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/middleware/webpack_proxy.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/gitlab/middleware/webpack_proxy.rb b/lib/gitlab/middleware/webpack_proxy.rb index 3fe32adeade..cb60c5f96ba 100644 --- a/lib/gitlab/middleware/webpack_proxy.rb +++ b/lib/gitlab/middleware/webpack_proxy.rb @@ -8,16 +8,16 @@ module Gitlab @proxy_host = opts.fetch(:proxy_host, 'localhost') @proxy_port = opts.fetch(:proxy_port, 3808) @proxy_path = opts[:proxy_path] if opts[:proxy_path] - super(app, opts) + + super(app, backend: "http://#{proxy_host}:#{proxy_port}", **opts) end def perform_request(env) - unless @proxy_path && env['PATH_INFO'].start_with?("/#{@proxy_path}") - return @app.call(env) + if @proxy_path && env['PATH_INFO'].start_with?("/#{@proxy_path}") + super(env) + else + @app.call(env) end - - env['HTTP_HOST'] = "#{@proxy_host}:#{@proxy_port}" - super(env) end end end |