Sha256: 0fc6111f5c4e3ec3e04799d9093632ee392d8061ffb7f66212b718d4a4e1ccf5

Contents?: true

Size: 637 Bytes

Versions: 2

Compression:

Stored size: 637 Bytes

Contents

# frozen_string_literal: true

module ElasticAPM
  class TraceContext
    # @api private
    class Tracestate
      def initialize(values = [])
        @values = values
      end

      attr_accessor :values

      def self.parse(header)
        # HTTP allows multiple headers with the same name, eg. multiple
        # Set-Cookie headers per response.
        # Rack handles this by joining the headers under the same key, separated
        # by newlines, see https://www.rubydoc.info/github/rack/rack/file/SPEC
        new(String(header).split("\n"))
      end

      def to_header
        values.join(',')
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
elastic-apm-3.6.0 lib/elastic_apm/trace_context/tracestate.rb
elastic-apm-3.5.0 lib/elastic_apm/trace_context/tracestate.rb