lib/logtail-rack/util/request.rb
def headers
        @headers ||= begin
          headers = {}

          @env.each_pair do |k, v|
            next unless k.is_a?(String) && k.to_s.start_with?(HTTP_PREFIX)

            k = k[5..-1].
              split(HTTP_HEADER_ORIGINAL_DELIMITER).
              each(&:capitalize!).
              join(HTTP_HEADER_NEW_DELIMITER)

            headers[k] = v
          end

          headers
        end
      end
# Returns a list of request headers. The rack env contains a lot of data, this function
# identifies those that were the actual request headers.
#
# This was extracted from: https://github.com/ruby-grape/grape/blob/91c6c78ae3d3f3ffabaf57ffc4dc35ab7cfc7b5f/lib/grape/request.rb#L30
Returns a list of request headers. The rack env contains a lot of data, this function
identifies those that were the actual request headers.


Returns a list of request headers . The rack env contains a lot of data this function identifies those that were the actual request headers .
def headers
        @headers ||= begin
          headers = {}
          @env.each_pair do |k, v|
            next unless k.is_a?(String) && k.to_s.start_with?(HTTP_PREFIX)
            k = k[5..-1].
              split(HTTP_HEADER_ORIGINAL_DELIMITER).
              each(&:capitalize!).
              join(HTTP_HEADER_NEW_DELIMITER)
            headers[k] = v
          end
          headers
        end
      end
def headers @headers ||= begin headers = { } @env . each_pair do | k , v | next unless k . is_a? ( String ) && k . to_s . start_with? ( HTTP_PREFIX ) k = k [ 5 .. - 1 ] . split ( HTTP_HEADER_ORIGINAL_DELIMITER ) . each ( & :capitalize! ) . join ( HTTP_HEADER_NEW_DELIMITER ) headers [ k ] = v end headers end end
Returns a list of request headers.
Returns a list of request headers .