Press J to jump to the feed. Press question mark to learn the rest of the keyboard shortcuts
11
11
Posted by10 days ago
bibwild.wordpress.com/2021/0...
6 comments
level 1
· 10d · edited 9d

*looks around nervously*

controller.request.send(:filtered_query_string)

This is a private method, but using it will ensure that you don't log sensitive values in query params, such as token, if your app uses them.

Edit: you could also use path: controller.request.filtered_path, which includes the filtered query string.

2
level 2
Op · 10d · edited 9d

Oh wow, good catch! Thanks so much! Although i don't think I have anything confidential in my own query string.

A bit unfortunate that's not a public method? Is there a filtered version of params? Looks like request.filtered_parameters? (edit, while filtered_query_string isn't public, filtered_path and filtered_parameters are!)

This is why we post things on the internet. :) i will update my post tomorrow (about to be off for today), and credit you.

I wonder if a PR should be made to lograge README using filtered_parameters... although not sure anyone's around to merge it...

2
More posts from the ruby community
Continue browsing in r/ruby
Welcome to ruby
72.3k

Members

63

Online


Created Jan 25, 2008