class TCellAgent::Policies::HeadersPolicy

Attributes

enabled[RW]

Public Class Methods

api_identifier() click to toggle source
# File lib/tcell_agent/policies/headers_policy.rb, line 6
def self.api_identifier
  'headers'
end
new(native_agent, enablements) click to toggle source
# File lib/tcell_agent/policies/headers_policy.rb, line 12
def initialize(native_agent, enablements)
  @native_agent = native_agent
  @enabled = enablements['headers'] || false
end

Public Instance Methods

get_headers(content_type, tcell_context) click to toggle source
# File lib/tcell_agent/policies/headers_policy.rb, line 17
def get_headers(content_type, tcell_context)
  return [] unless @enabled

  response = @native_agent.get_headers(content_type, tcell_context)
  response['headers'] || []
end