From 5c4ae4db0e5768ce17a5cc6d706370402c57997b Mon Sep 17 00:00:00 2001 From: vilyapilya <13.veter@gmail.com> Date: Mon, 7 Oct 2019 18:14:57 -0700 Subject: [PATCH 1/5] add user-agent --- lib/logdna.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/logdna.rb b/lib/logdna.rb index 0899917..97da21f 100755 --- a/lib/logdna.rb +++ b/lib/logdna.rb @@ -21,7 +21,7 @@ def initialize(key, opts={}) @env = opts[:env] @meta = opts[:meta] @@client = nil unless defined? @@client - + endpoint = opts[:endpoint] || Resources::ENDPOINT hostname = opts[:hostname] || Socket.gethostname ip = opts.key?(:ip) ? "&ip=#{opts[:ip]}" : '' @@ -49,6 +49,7 @@ def initialize(key, opts={}) begin request = Net::HTTP::Post.new(uri.request_uri, 'Content-Type' => 'application/json') request.basic_auth 'username', key + request['user-agent'] = opts[:rails_logdna_v] || "ruby/#{LogDNA::VERSION}" rescue => e handle_exception(e) return From 3ff10d498f4699eca15f8fe74eae4a2d534cb9fa Mon Sep 17 00:00:00 2001 From: vilyapilya <13.veter@gmail.com> Date: Mon, 7 Oct 2019 18:16:16 -0700 Subject: [PATCH 2/5] remove extra space --- lib/logdna.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/logdna.rb b/lib/logdna.rb index 97da21f..75ed7ca 100755 --- a/lib/logdna.rb +++ b/lib/logdna.rb @@ -21,7 +21,6 @@ def initialize(key, opts={}) @env = opts[:env] @meta = opts[:meta] @@client = nil unless defined? @@client - endpoint = opts[:endpoint] || Resources::ENDPOINT hostname = opts[:hostname] || Socket.gethostname ip = opts.key?(:ip) ? "&ip=#{opts[:ip]}" : '' From 8f0b4e365c39c22c294008f1948c0a51e523166d Mon Sep 17 00:00:00 2001 From: vilyapilya <13.veter@gmail.com> Date: Mon, 7 Oct 2019 18:16:53 -0700 Subject: [PATCH 3/5] add --- lib/logdna.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/logdna.rb b/lib/logdna.rb index 75ed7ca..97da21f 100755 --- a/lib/logdna.rb +++ b/lib/logdna.rb @@ -21,6 +21,7 @@ def initialize(key, opts={}) @env = opts[:env] @meta = opts[:meta] @@client = nil unless defined? @@client + endpoint = opts[:endpoint] || Resources::ENDPOINT hostname = opts[:hostname] || Socket.gethostname ip = opts.key?(:ip) ? "&ip=#{opts[:ip]}" : '' From 5cc7e2e0849b8bd0d423f85ce48d0246a9d155f0 Mon Sep 17 00:00:00 2001 From: vilyapilya <13.veter@gmail.com> Date: Wed, 9 Oct 2019 11:14:44 -0700 Subject: [PATCH 4/5] change the name to user-agent --- lib/logdna.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/logdna.rb b/lib/logdna.rb index 97da21f..d7a9551 100755 --- a/lib/logdna.rb +++ b/lib/logdna.rb @@ -49,7 +49,7 @@ def initialize(key, opts={}) begin request = Net::HTTP::Post.new(uri.request_uri, 'Content-Type' => 'application/json') request.basic_auth 'username', key - request['user-agent'] = opts[:rails_logdna_v] || "ruby/#{LogDNA::VERSION}" + request['user-agent'] = opts['user-agent'] || "ruby/#{LogDNA::VERSION}" rescue => e handle_exception(e) return From ab40db0282a5a34e52e6872318cd06990bfd0727 Mon Sep 17 00:00:00 2001 From: vilyapilya <13.veter@gmail.com> Date: Mon, 14 Oct 2019 13:08:32 -0700 Subject: [PATCH 5/5] change to :'user-agent' --- lib/logdna.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/logdna.rb b/lib/logdna.rb index d7a9551..8372a1a 100755 --- a/lib/logdna.rb +++ b/lib/logdna.rb @@ -49,7 +49,7 @@ def initialize(key, opts={}) begin request = Net::HTTP::Post.new(uri.request_uri, 'Content-Type' => 'application/json') request.basic_auth 'username', key - request['user-agent'] = opts['user-agent'] || "ruby/#{LogDNA::VERSION}" + request[:'user-agent'] = opts[:'user-agent'] || "ruby/#{LogDNA::VERSION}" rescue => e handle_exception(e) return