Commit 48707bc2 authored by Mike Greiling's avatar Mike Greiling

ensure webpack dev server proxy connects regardless of request headers

parent 83d44076
...@@ -8,16 +8,16 @@ module Gitlab ...@@ -8,16 +8,16 @@ module Gitlab
@proxy_host = opts.fetch(:proxy_host, 'localhost') @proxy_host = opts.fetch(:proxy_host, 'localhost')
@proxy_port = opts.fetch(:proxy_port, 3808) @proxy_port = opts.fetch(:proxy_port, 3808)
@proxy_path = opts[:proxy_path] if opts[:proxy_path] @proxy_path = opts[:proxy_path] if opts[:proxy_path]
super(app, opts)
end
def perform_request(env) super(app, backend: "http://#{proxy_host}:#{proxy_port}", **opts)
unless @proxy_path && env['PATH_INFO'].start_with?("/#{@proxy_path}")
return @app.call(env)
end end
env['HTTP_HOST'] = "#{@proxy_host}:#{@proxy_port}" def perform_request(env)
if @proxy_path && env['PATH_INFO'].start_with?("/#{@proxy_path}")
super(env) super(env)
else
@app.call(env)
end
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