Sha256: e815493f71b4f5d07939e2c14f781ca6efadb9011de018b08d92a16d9d811df5

Contents?: true

Size: 1.22 KB

Versions: 18

Compression:

Stored size: 1.22 KB

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.

module NewRelic
  module Agent
    module HTTPClients

      class CurbRequest
        def initialize( curlobj )
          @curlobj = curlobj
        end

        def type
          'Curb'
        end

        def host
          self["host"] || self["Host"] || self.uri.host
        end

        def method
          @curlobj._nr_http_verb
        end

        def []( key )
          @curlobj.headers[ key ]
        end

        def []=( key, value )
          @curlobj.headers[ key ] = value
        end

        def uri
          @uri ||= URI( @curlobj.url )
        end
      end


      class CurbResponse

        def initialize(curlobj)
          @headers = {}
          @curlobj = curlobj
        end

        def [](key)
          @headers[ key.downcase ]
        end

        def to_hash
          @headers.dup
        end

        def append_header_data( data )
          key, value = data.split( /:\s*/, 2 )
          @headers[ key.downcase ] = value
          @curlobj._nr_header_str ||= ''
          @curlobj._nr_header_str << data
        end

      end

    end

  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
newrelic_rpm-3.8.1.221 lib/new_relic/agent/http_clients/curb_wrappers.rb
newrelic_rpm-3.8.0.218 lib/new_relic/agent/http_clients/curb_wrappers.rb
newrelic_rpm-3.7.3.204 lib/new_relic/agent/http_clients/curb_wrappers.rb
newrelic_rpm-3.7.3.199 lib/new_relic/agent/http_clients/curb_wrappers.rb
newrelic_rpm-3.7.2.195 lib/new_relic/agent/http_clients/curb_wrappers.rb
newrelic_rpm-3.7.2.192 lib/new_relic/agent/http_clients/curb_wrappers.rb
newrelic_rpm-3.7.2.190.beta lib/new_relic/agent/http_clients/curb_wrappers.rb
newrelic_rpm-3.7.1.188 lib/new_relic/agent/http_clients/curb_wrappers.rb
newrelic_rpm-3.7.1.182 lib/new_relic/agent/http_clients/curb_wrappers.rb
newrelic_rpm-3.7.1.180 lib/new_relic/agent/http_clients/curb_wrappers.rb
newrelic_rpm-3.7.0.177 lib/new_relic/agent/http_clients/curb_wrappers.rb
newrelic_rpm-3.7.0.174.beta lib/new_relic/agent/http_clients/curb_wrappers.rb
newrelic_rpm-3.6.9.171 lib/new_relic/agent/http_clients/curb_wrappers.rb
newrelic_rpm-3.6.8.168 lib/new_relic/agent/http_clients/curb_wrappers.rb
newrelic_rpm-3.6.8.164 lib/new_relic/agent/http_clients/curb_wrappers.rb
newrelic_rpm-3.6.7.159 lib/new_relic/agent/http_clients/curb_wrappers.rb
newrelic_rpm-3.6.7.159.beta lib/new_relic/agent/http_clients/curb_wrappers.rb
newrelic_rpm-3.6.7.152 lib/new_relic/agent/http_clients/curb_wrappers.rb