Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48941 from skipkayhil/hm-show-correct-blocked-hosts
Fix host display when X_FORWARDED_HOST authorized
- Loading branch information
Showing
5 changed files
with
45 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 7 additions & 3 deletions
10
actionpack/lib/action_dispatch/middleware/templates/rescues/blocked_host.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
<header> | ||
<h1>Blocked host: <%= @host %></h1> | ||
<h1>Blocked hosts: <%= @hosts.join(", ") %></h1> | ||
</header> | ||
<main role="main" id="container"> | ||
<h2>To allow requests to <%= @host %> make sure it is a valid hostname (containing only numbers, letters, dashes and dots), then add the following to your environment configuration:</h2> | ||
<pre>config.hosts << "<%= @host %>"</pre> | ||
<h2>To allow requests to these hosts, make sure they are valid hostnames (containing only numbers, letters, dashes and dots), then add the following to your environment configuration:</h2> | ||
<pre> | ||
<% @hosts.each do |host| %> | ||
config.hosts << "<%= host %>" | ||
<% end %> | ||
</pre> | ||
<p>For more details view: <a href="https://guides.rubyonrails.org/configuring.html#actiondispatch-hostauthorization">the Host Authorization guide</a></p> | ||
</main> |
8 changes: 5 additions & 3 deletions
8
actionpack/lib/action_dispatch/middleware/templates/rescues/blocked_host.text.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
Blocked host: <%= @host %> | ||
Blocked hosts: <%= @hosts.join(", ") %> | ||
|
||
To allow requests to <%= @host %> make sure it is a valid hostname (containing only numbers, letters, dashes and dots), then add the following to your environment configuration: | ||
To allow requests to these hosts, make sure they are valid hostnames (containing only numbers, letters, dashes and dots), then add the following to your environment configuration: | ||
|
||
config.hosts << "<%= @host %>" | ||
<% @hosts.each do |host| %> | ||
config.hosts << "<%= host %>" | ||
<% end %> | ||
|
||
For more details on host authorization view: https://guides.rubyonrails.org/configuring.html#actiondispatch-hostauthorization |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters