SSO 和筛选的 IP 地址

我可能高兴得太早了。:disappointed_face:

在将 truthy/falsy 参数修正为 ‘true’/‘false’ 字符串后,我发现在删除用户时,仍有条目被添加到“屏蔽 IP"和“屏蔽邮箱”中。

以下是某次 API 调用的 Rails 日志:

Started DELETE "/admin/users/9553.json" for 123.123.123.123 at 2021-06-10 00:01:21 +0000
Processing by Admin::UsersController#destroy as JSON
  Parameters: {"delete_posts"=>"false", "block_email"=>"false", "blocked_urls"=>"false", "block_ip"=>"false", "id"=>"9553"}
Can't verify CSRF token authenticity.
  Rendering text template
  Rendered text template (Duration: 0.0ms | Allocations: 1)
Completed 418  in 8ms (Views: 1.4ms | ActiveRecord: 0.0ms | Allocations: 2301)

而通过 Web 界面(而非直接调用 API)执行时的请求如下:

Started DELETE "/admin/users/49.json" for 123.123.123.123 at 2021-06-10 08:24:47 +0000
Processing by Admin::UsersController#destroy as JSON
  Parameters: {"context"=>"/admin/users/49/XXX", "delete_posts"=>"true", "id"=>"49"}
  Rendered text template (Duration: 0.0ms | Allocations: 1)
Completed 418  in 23ms (Views: 4.7ms | ActiveRecord: 0.0ms | Allocations: 1778)

因此,经过一些测试后,似乎 API 端点 /admin/users/{id}.json 的参数只要存在,就始终被解释为 true,而不管其实际值被设置为 ‘true’ 还是 ‘false’?

当我开始仅设置值为 ‘true’ 的参数,而跳过值为 ‘false’ 的参数后,就不再向“屏蔽 IP/邮箱”中添加任何条目了。

这是预期的行为吗?这与我根据 文档 所理解的内容不符。