Class: Karafka::Web::Pro::Ui::Lib::Search::Matchers::RawHeaderIncludes

Inherits:
Base
  • Object
show all
Defined in:
lib/karafka/web/pro/ui/lib/search/matchers/raw_header_includes.rb

Overview

Note:

It is case sensitive

Note:

Ignores encoding issues

Matcher that searches in the raw headers. If any header key or value matches the phrase, it is true. Otherwise false.

Instance Method Summary collapse

Methods inherited from Base

active?, name

Instance Method Details

#call(message, phrase) ⇒ Boolean

Returns does message raw headers contain the phrase.

Parameters:

  • message (Karafka::Messages::Message)
  • phrase (String)

Returns:

  • (Boolean)

    does message raw headers contain the phrase



30
31
32
33
34
35
36
37
# File 'lib/karafka/web/pro/ui/lib/search/matchers/raw_header_includes.rb', line 30

def call(message, phrase)
  message.raw_headers.each do |raw_header_key, raw_header_value|
    return true if safe_include?(raw_header_key, phrase)
    return true if safe_include?(raw_header_value, phrase)
  end

  false
end