Skip to content

Commit c057eda

Browse files
authored
Merge pull request rails#50277 from skipkayhil/hm-nfd-open-redirects
Improve doc for raise_on_open_redirects [ci-skip]
2 parents 61a806e + ecbe5f9 commit c057eda

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

guides/source/configuring.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1769,7 +1769,14 @@ Raises an `AbstractController::ActionNotFound` when the action specified in call
17691769

17701770
#### `config.action_controller.raise_on_open_redirects`
17711771

1772-
Raises an `ActionController::Redirecting::UnsafeRedirectError` when an unpermitted open redirect occurs.
1772+
Protect an application from unintentionally redirecting to an external host
1773+
(also known as an "open redirect") by making external redirects opt-in.
1774+
1775+
When this configuration is set to `true`, an
1776+
`ActionController::Redirecting::UnsafeRedirectError` will be raised when a URL
1777+
with an external host is passed to [redirect_to][]. If an open redirect should
1778+
be allowed, then `allow_other_host: true` can be added to the call to
1779+
`redirect_to`.
17731780

17741781
The default value depends on the `config.load_defaults` target version:
17751782

@@ -1778,6 +1785,8 @@ The default value depends on the `config.load_defaults` target version:
17781785
| (original) | `false` |
17791786
| 7.0 | `true` |
17801787

1788+
[redirect_to]: https://api.rubyonrails.org/classes/ActionController/Redirecting.html#method-i-redirect_to
1789+
17811790
#### `config.action_controller.log_query_tags_around_actions`
17821791

17831792
Determines whether controller context for query tags will be automatically

0 commit comments

Comments
 (0)