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/action_dispatch
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
..
http Catch invalid UTF-8 encodings on ActionDispatch::Http::Request#POST (#40124) 2020-09-21 15:20:20 -04:00
journey ✂️ [ci skip] 2020-09-16 09:52:10 +09:00
middleware Merge pull request #39363 from p8/format-did-you-mean-suggestions-on-error-pages 2020-08-26 16:15:36 -04:00
request Catch invalid UTF-8 encodings on ActionDispatch::Http::Request#POST (#40124) 2020-09-21 15:20:20 -04:00
routing Alter regexp on initialize to avoid extra ast pass 2020-07-23 11:51:08 -04:00
system_testing Load selenium/webdriver only if needed 2020-05-07 15:53:32 +03:00
testing Remove obsolete comment [skip ci] 2020-09-19 17:42:53 +09:00
journey.rb Remove unused journey code 2020-04-25 00:40:37 +09:00
railtie.rb Heed config.force_ssl when building URL 2020-04-05 18:19:31 -05:00
routing.rb Fix code examples' indentation in ActionDispatch::Routing [ci skip] 2019-02-26 14:04:08 -05:00
system_test_case.rb Load selenium/webdriver only if needed 2020-05-07 15:53:32 +03:00