Skip to content

Commit

Permalink
DSN#server shouldn't include path (#1505)
Browse files Browse the repository at this point in the history
The path will be applied to `DSN#envelope_endpoint` anyway, so if
`#server` also contains the path it'll be repeated.
  • Loading branch information
st0012 authored Jul 16, 2021
1 parent 6cc8966 commit 3d82d7f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 0 additions & 1 deletion sentry-ruby/lib/sentry/dsn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def to_s
def server
server = "#{scheme}://#{host}"
server += ":#{port}" unless port == PORT_MAP[scheme]
server += path
server
end

Expand Down
6 changes: 6 additions & 0 deletions sentry-ruby/spec/sentry/dsn_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion sentry-ruby/spec/sentry/transport/http_transport_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3d82d7f

Please sign in to comment.