forked from rails/rails
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle bad URIs when filtering redirects
rails#51131 introduced parameter filtering for redirects. We didn't account for invalid URIs though, and it changes the behaviour of redirect_to to raise URI errors when we try to filter a bad URI. Instead, we should fallback to filtering bad URIs entirely to preserve behaviour.
- Loading branch information
1 parent
d8a9be8
commit 053470a
Showing
2 changed files
with
16 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,8 @@ def parameter_filtered_location | |
end | ||
end | ||
uri.to_s | ||
rescue URI::Error | ||
FILTERED | ||
end | ||
end | ||
end | ||
|
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