From 3e7bdcbbc1c192cad42367a61c5e500b73f1889d Mon Sep 17 00:00:00 2001 From: Nate Berkopec Date: Fri, 5 Dec 2014 16:15:40 -0500 Subject: [PATCH] Fix API path prefixing Fix #255 --- lib/raven/transports/http.rb | 2 +- spec/raven/integration_spec.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/raven/transports/http.rb b/lib/raven/transports/http.rb index 30f489a88..be3cb7783 100644 --- a/lib/raven/transports/http.rb +++ b/lib/raven/transports/http.rb @@ -9,7 +9,7 @@ class HTTP < Transport def send(auth_header, data, options = {}) project_id = self.configuration[:project_id] - path = self.configuration[:path].gsub('/sentry', '') + "/" + path = self.configuration[:path] + "/" response = conn.post "#{path}api/#{project_id}/store/" do |req| req.headers['Content-Type'] = options[:content_type] diff --git a/spec/raven/integration_spec.rb b/spec/raven/integration_spec.rb index 7900df787..db299fc14 100644 --- a/spec/raven/integration_spec.rb +++ b/spec/raven/integration_spec.rb @@ -5,7 +5,7 @@ example "posting an exception" do stubs = Faraday::Adapter::Test::Stubs.new do |stub| - stub.post('/api/42/store/') { [200, {}, 'ok'] } + stub.post('sentry/api/42/store/') { [200, {}, 'ok'] } end Raven.configure do |config| @@ -24,7 +24,7 @@ example "posting an exception to a prefixed DSN" do stubs = Faraday::Adapter::Test::Stubs.new do |stub| - stub.post('/prefix/api/42/store/') { [200, {}, 'ok'] } + stub.post('/prefix/sentry/api/42/store/') { [200, {}, 'ok'] } end Raven.configure do |config| @@ -42,7 +42,7 @@ example "hitting quota limit shouldn't swallow exception" do stubs = Faraday::Adapter::Test::Stubs.new do |stub| - stub.post('/api/42/store/') { [403, {}, 'Creation of this event was blocked'] } + stub.post('sentry/api/42/store/') { [403, {}, 'Creation of this event was blocked'] } end Raven.configure do |config|