File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
require 'raven/transports'
4
4
require 'raven/error'
5
+ require 'pry'
5
6
6
7
module Raven
7
8
module Transports
8
9
class HTTP < Transport
9
10
10
11
def send ( auth_header , data , options = { } )
11
12
project_id = self . configuration [ :project_id ]
12
- response = conn . post "/api/#{ project_id } /store/" do |req |
13
+ path = self . configuration [ :path ] . gsub ( '/sentry' , '' ) + "/"
14
+
15
+ response = conn . post "#{ path } api/#{ project_id } /store/" do |req |
13
16
req . headers [ 'Content-Type' ] = options [ :content_type ]
14
17
req . headers [ 'X-Sentry-Auth' ] = auth_header
15
18
req . body = data
Original file line number Diff line number Diff line change 21
21
22
22
end
23
23
24
+ example "posting an exception to a prefixed DSN" do
25
+
26
+ stubs = Faraday ::Adapter ::Test ::Stubs . new do |stub |
27
+ stub . post ( '/prefix/api/42/store/' ) { [ 200 , { } , 'ok' ] }
28
+ end
29
+
30
+ Raven . configure do |config |
31
+ config . server = 'http://12345:67890@sentry.localdomain/prefix/sentry/42'
32
+ config . environments = [ "test" ]
33
+ config . current_environment = "test"
34
+ config . http_adapter = [ :test , stubs ]
35
+ end
36
+
37
+ Raven . capture_exception ( build_exception )
38
+
39
+ stubs . verify_stubbed_calls
40
+ end
41
+
24
42
example "hitting quota limit shouldn't swallow exception" do
25
43
26
44
stubs = Faraday ::Adapter ::Test ::Stubs . new do |stub |
You can’t perform that action at this time.
0 commit comments