Skip to content

Commit ee0634b

Browse files
committed
add default user-agent
closes excon#249
1 parent 4bf3f6e commit ee0634b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/excon.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ def defaults
2020
:connect_timeout => 60,
2121
:debug_request => false,
2222
:debug_response => false,
23-
:headers => {},
23+
:headers => {
24+
'User-Agent' => USER_AGENT
25+
},
2426
:idempotent => false,
2527
:instrumentor_name => 'excon',
2628
:middlewares => [

lib/excon/constants.rb

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ module Excon
7878
]
7979

8080
VERSION = '0.25.1'
81+
USER_AGENT = 'excon/' << VERSION
8182

8283
unless ::IO.const_defined?(:WaitReadable)
8384
class ::IO

0 commit comments

Comments
 (0)