1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/lib
Adrianna Chang 7dc53ec91d
Catch invalid UTF-8 encodings on ActionDispatch::Http::Request#POST (#40124)
* Add binary encoding logic into ActionDispatch::Request::Utils

Moving the logic to set binary encoding into ActionDispatch::Request::Utils
will allow us to encode from GET and POST in ActionDispatch::Request.

* Refactor binary encoding logic

- Move binary encoding calls into GET, POST and path_parameters
- Remove binary encoding from ActionDispatch::Http::Request
- This way, we only raise an invalid encoding exception if the controller is not requesting
parameters in binary encoding

* Check if encoding is valid in ActionDispatch::Request#POST and raise BadRequest if invalid

* Fix multipart_params_test that has binary-encoded params containing invalid UTF-8 characters

* Address PR comments

* Pass action and controller to Request::Utils.set_binary_encoding

[Rafael Mendonça França + Adrianna Chang]
2020-09-21 15:20:20 -04:00
..
abstract_controller Shorten inspect on AbstractController::Base 2020-09-05 19:37:31 +02:00
action_controller ✂️ [ci skip] 2020-09-16 09:52:10 +09:00
action_dispatch Catch invalid UTF-8 encodings on ActionDispatch::Http::Request#POST (#40124) 2020-09-21 15:20:20 -04:00
action_pack Start Rails 6.1 development 2019-04-24 15:57:14 -04:00
abstract_controller.rb Make sure to require active_support.rb before requiring active_support/rails.rb 2019-07-12 18:30:58 +09:00
action_controller.rb Remove invalid autoloads in top-level Rails modules 2020-06-08 17:21:26 -04:00
action_dispatch.rb Clear cache after setting Template::Types delegate 2020-05-21 22:43:13 -07:00
action_pack.rb Bump license years from 2019 to 2020 [ci skip] 2020-01-01 15:10:31 +05:30