1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/test
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 Unify raise_on_missing_translations for views and controllers 2020-05-20 02:42:59 +03:00
assertions Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00
controller URL helper methods on controllers are public methods 2020-09-16 12:15:24 +09:00
dispatch Catch invalid UTF-8 encodings on ActionDispatch::Http::Request#POST (#40124) 2020-09-21 15:20:20 -04:00
fixtures Allow rails to serve brotli encoded assets 2020-06-01 08:57:02 -07:00
journey Move Path::Pattern factories into test helper 2020-07-27 12:23:33 -04:00
lib Document view components support (#38656) 2020-03-13 23:52:49 +01:00
routing Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00
support Move Path::Pattern factories into test helper 2020-07-27 12:23:33 -04:00
abstract_unit.rb Stop using a singleton for routes 2020-07-14 13:46:54 -04:00