summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-02-27 17:31:36 +0000
committerDouwe Maan <douwe@gitlab.com>2017-02-27 17:31:36 +0000
commit34685c588aa7d5d71d3f27d6d85a20e13389357d (patch)
tree21c6ea2ec31185accf91ff330fbbd973c354b6ec
parentbbba5eb06a09c94556cfc20c5580b3f779c49fea (diff)
parent48707bc2aba86ce0384be8d21c80637737b1c17c (diff)
downloadgitlab-ce-34685c588aa7d5d71d3f27d6d85a20e13389357d.tar.gz
Merge branch 'fix-webpack-dev-server-proxy' into 'master'
Fix webpack dev server when behind proxy See merge request !9543
-rw-r--r--lib/gitlab/middleware/webpack_proxy.rb12
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