File tree Expand file tree Collapse file tree 3 files changed +31
-2
lines changed
lib/appsignal/integrations
spec/lib/appsignal/integrations Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ bump : patch
3
+ type : fix
4
+ ---
5
+
6
+ Fix an issue where the HTTP.rb gem integration would raise an error when a string containing non-ASCII characters is passed to the gem as the URL.
Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ module Integrations
5
5
# @api private
6
6
module HttpIntegration
7
7
def request ( verb , uri , opts = { } )
8
- parsed_request_uri = uri . is_a? ( URI ) ? uri : URI . parse ( uri . to_s )
8
+ uri_module = defined? ( HTTP ::URI ) ? HTTP ::URI : URI
9
+ parsed_request_uri = uri . is_a? ( URI ) ? uri : uri_module . parse ( uri . to_s )
9
10
request_uri = "#{ parsed_request_uri . scheme } ://#{ parsed_request_uri . host } "
10
11
11
12
Appsignal . instrument ( "request.http_rb" , "#{ verb . upcase } #{ request_uri } " ) do
Original file line number Diff line number Diff line change @@ -96,7 +96,18 @@ def to_s
96
96
)
97
97
end
98
98
99
- it "parses a String object" do
99
+ it "parses an HTTP::URI object" do
100
+ stub_request ( :get , "http://www.google.com" )
101
+
102
+ HTTP . get ( HTTP ::URI . parse ( "http://www.google.com" ) )
103
+
104
+ expect ( transaction ) . to include_event (
105
+ "name" => "request.http_rb" ,
106
+ "title" => "GET http://www.google.com"
107
+ )
108
+ end
109
+
110
+ it "parses a string" do
100
111
stub_request ( :get , "http://www.google.com" )
101
112
102
113
HTTP . get ( "http://www.google.com" )
@@ -106,6 +117,17 @@ def to_s
106
117
"title" => "GET http://www.google.com"
107
118
)
108
119
end
120
+
121
+ it "parses a string with non-ascii characters" do
122
+ stub_request ( :get , "http://www.example.com/áéíóúãÔù" )
123
+
124
+ HTTP . get ( "http://www.example.com/áéíóúãÔù" )
125
+
126
+ expect ( transaction ) . to include_event (
127
+ "name" => "request.http_rb" ,
128
+ "title" => "GET http://www.example.com"
129
+ )
130
+ end
109
131
end
110
132
end
111
133
end
You can’t perform that action at this time.
0 commit comments