Skip to content

Commit

Permalink
Support filtering for multiple IPs
Browse files Browse the repository at this point in the history
This commit combines processing for double and single quoted filter_value

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1684681
  • Loading branch information
jvlcek committed Jun 6, 2019
1 parent db0e9ec commit 8b3a4e8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/api/filter.rb
Expand Up @@ -81,10 +81,9 @@ def parse_filter(filter)
str_method = is_regex ? methods[:regex] : methods[:default]

filter_value, method = case filter_value
when /^'.*'$/
[filter_value.gsub(/^'|'$/, ''), str_method]
when /^".*"$/
[filter_value.gsub(/^"|"$/, ''), str_method]
when /^['"](.*)['"]$/
unquoted_filter_value = $1
[unquoted_filter_value, str_method]
when /^(NULL|nil)$/i
[nil, methods[:null] || methods[:default]]
else
Expand Down

0 comments on commit 8b3a4e8

Please sign in to comment.