Skip to content

config.dsn does not respect port  #1699

@laurafeier

Description

@laurafeier

Issue Description

Custom port is not respected by default transport.
I assume the problem is in the http transport class

server = URI(@dsn.server)
use_ssl = server.scheme == "https"
port = use_ssl ? 443 : 80

This probably need to be changed in

server = URI(@dsn.server)
use_ssl = server.scheme == "https"
port = server.port

Reproduction Steps

Use custom dsn with custom port.

Expected Behavior

Connection should respect custom port. Instead it is enforced to 80.

Actual Behavior

ERROR -- sentry: exception happened in background worker: Failed to open TCP connection to 75.81.74.93:80 (Connection refused - connect(2) for "75.81.74.93" port 80)

Ruby Version

3.0.2p107

SDK Version

5.0.1

Integration and Its Version

rails 6.1.4.4

Sentry Config

config.dsn = 'http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@75.81.74.93:9000/1'

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions