Skip to content

Commit

Permalink
Fix incorrect host forwarding (#2515)
Browse files Browse the repository at this point in the history
Add missing port forwarding
  • Loading branch information
olzv committed Apr 11, 2020
1 parent 09caeed commit 311bada
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/webpacker/dev_server_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ def initialize(app = nil, opts = {})

def perform_request(env)
if env["PATH_INFO"].start_with?("/#{public_output_uri_path}") && dev_server.running?
env["HTTP_HOST"] = env["HTTP_X_FORWARDED_HOST"] = env["HTTP_X_FORWARDED_SERVER"] = dev_server.host_with_port
env["HTTP_HOST"] = env["HTTP_X_FORWARDED_HOST"] = dev_server.host
env["HTTP_X_FORWARDED_SERVER"] = dev_server.host_with_port
env["HTTP_PORT"] = env["HTTP_X_FORWARDED_PORT"] = dev_server.port.to_s
env["HTTP_X_FORWARDED_PROTO"] = env["HTTP_X_FORWARDED_SCHEME"] = dev_server.protocol
unless dev_server.https?
env["HTTPS"] = env["HTTP_X_FORWARDED_SSL"] = "off"
Expand Down

0 comments on commit 311bada

Please sign in to comment.