Skip to content

Commit

Permalink
Handle http dev_server setting properly in the proxy (#1420)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjohnson authored and gauravtiwari committed Apr 16, 2018
1 parent 490e8d5 commit 182fab0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/webpacker/dev_server_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ def rewrite_response(response)
def perform_request(env)
if env["PATH_INFO"].start_with?("/#{public_output_uri_path}") && Webpacker.dev_server.running?
env["HTTP_HOST"] = env["HTTP_X_FORWARDED_HOST"] = env["HTTP_X_FORWARDED_SERVER"] = Webpacker.dev_server.host_with_port
env["HTTP_X_FORWARDED_PROTO"] = Webpacker.dev_server.protocol
env["HTTP_X_FORWARDED_PROTO"] = env["HTTP_X_FORWARDED_SCHEME"] = Webpacker.dev_server.protocol
unless Webpacker.dev_server.https?
env["HTTPS"] = env["HTTP_X_FORWARDED_SSL"] = "off"
end
env["SCRIPT_NAME"] = ""

super(env)
Expand Down

0 comments on commit 182fab0

Please sign in to comment.