From 9b51ee9f925e9c1f64d0bae2039ff70cea0d0959 Mon Sep 17 00:00:00 2001 From: Alireza Bashiri Date: Fri, 20 Jul 2018 15:18:49 +0430 Subject: Prevent `RequestEncoder#encode_params` to parse falsey params When a `get` method called with `as: :json` and `params: nil` or `params: false` (explicitly or implicitly) `RequestEncoder#encode_params` converts it into a `null` or `false` value which includes a unexpected `null=` or `false` query string into request URL. From now on `RequestEncoder#encode_params` checks whether `params` is nil or not otherwise returns. Move down `nil` conversion guard Update CHANGELOG.md --- actionpack/CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'actionpack/CHANGELOG.md') diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index 7645b2b0e7..af8ecb7e2a 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -50,5 +50,12 @@ *Jeremy Daer* +* Prevent `RequestEncoder#encode_params` to parse falsey params + + Now `RequestEncoder#encode_params` doesn't convert + falsey params into query string. + + *Alireza Bashiri* + Please check [5-2-stable](https://github.com/rails/rails/blob/5-2-stable/actionpack/CHANGELOG.md) for previous changes. -- cgit v1.2.3