Sha256: 564dbd4cba0d1a8b9defd9fd299d608ff9cbb1a54758f57bf8f122eabc54e064
Contents?: true
Size: 1.04 KB
Versions: 12
Compression:
Stored size: 1.04 KB
Contents
# typed: true require_relative '../../metadata/ext' module Datadog module Tracing module Contrib module Sinatra # Gets and sets trace information from a Rack headers Hash module Headers module_function def response_header_tags(headers, target_headers) target_headers ||= [] {}.tap do |result| target_headers.each do |header| if headers.key?(header) result[Tracing::Metadata::Ext::HTTP::ResponseHeaders.to_tag(header)] = headers[header] else # Try a case-insensitive lookup uppercased_header = header.to_s.upcase matching_header = headers.keys.find { |h| h.upcase == uppercased_header } if matching_header result[Tracing::Metadata::Ext::HTTP::ResponseHeaders.to_tag(header)] = headers[matching_header] end end end end end end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems