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 22
33require 'raven/transports'
44require 'raven/error'
5+ require 'pry'
56
67module Raven
78 module Transports
89 class HTTP < Transport
910
1011 def send ( auth_header , data , options = { } )
1112 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 |
1316 req . headers [ 'Content-Type' ] = options [ :content_type ]
1417 req . headers [ 'X-Sentry-Auth' ] = auth_header
1518 req . body = data
Original file line number Diff line number Diff line change 2121
2222 end
2323
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+
2442 example "hitting quota limit shouldn't swallow exception" do
2543
2644 stubs = Faraday ::Adapter ::Test ::Stubs . new do |stub |
You can’t perform that action at this time.
0 commit comments