diff --git a/CHANGELOG.md b/CHANGELOG.md index f5a135034..7f18c045d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ - Declare `resque` as `sentry-resque`'s dependency [#1503](https://github.com/getsentry/sentry-ruby/pull/1503) - Fixes [#1502](https://github.com/getsentry/sentry-ruby/issues/1502) +- `DSN#server` shouldn't include path [#1505](https://github.com/getsentry/sentry-ruby/pull/1505) ## 4.6.1 diff --git a/sentry-ruby/lib/sentry/dsn.rb b/sentry-ruby/lib/sentry/dsn.rb index 51dac8546..f625acfaa 100644 --- a/sentry-ruby/lib/sentry/dsn.rb +++ b/sentry-ruby/lib/sentry/dsn.rb @@ -37,7 +37,6 @@ def to_s def server server = "#{scheme}://#{host}" server += ":#{port}" unless port == PORT_MAP[scheme] - server += path server end diff --git a/sentry-ruby/spec/sentry/dsn_spec.rb b/sentry-ruby/spec/sentry/dsn_spec.rb index b234a095e..e418df001 100644 --- a/sentry-ruby/spec/sentry/dsn_spec.rb +++ b/sentry-ruby/spec/sentry/dsn_spec.rb @@ -25,4 +25,10 @@ expect(subject.envelope_endpoint).to eq("/sentry/api/42/envelope/") end end + + describe "#server" do + it "returns scheme + host" do + expect(subject.server).to eq("http://sentry.localdomain:3000") + end + end end diff --git a/sentry-ruby/spec/sentry/transport/http_transport_spec.rb b/sentry-ruby/spec/sentry/transport/http_transport_spec.rb index 641bb408e..6a56d1188 100644 --- a/sentry-ruby/spec/sentry/transport/http_transport_spec.rb +++ b/sentry-ruby/spec/sentry/transport/http_transport_spec.rb @@ -21,7 +21,7 @@ subject - expect(string_io.string).to include("sentry: Sentry HTTP Transport connecting to http://sentry.localdomain/sentry") + expect(string_io.string).to include("sentry: Sentry HTTP Transport connecting to http://sentry.localdomain") end describe "customizations" do