Skip to content

Net::HTTP tracing doesn't support URIs with non ascii characters. #2418

Closed

Description

Issue Description

When building traces for Net::HTTP sentry does not escape the string passed to URI.parse resulting in URI::InvalidURIError being raised if non-ascii characters are present in the path.

https://github.com/getsentry/sentry-ruby/blob/master/sentry-ruby/lib/sentry/net/http.rb#L69

Reproduction Steps

While using sentry, use Net::HTTP to send a request to a URI using non-ascii characters.

Sentry has no additional configuration:

Sentry.init do |sentry_config|
  sentry_config.dsn = config.fetch(:dsn)
end

Expected Behavior

When sentry tries to extract the request information, there should not be errors when the path contains non-ascii characters.

Actual Behavior

When sentry tries to extract the request information on Net::HTTP request traces, if the path contains non-ascii characters, the trace results in a URI::InvalidURIError.

Ruby Version

2.7, 3.x

SDK Version

5.19.0

Integration and Its Version

  • sentry-ruby
  • sentry-rails
  • sentry-delayed_job

Sentry Config

Sentry.init do |config|
  config.breadcrumbs_logger = [:active_support_logger, :http_logger, :sentry_logger]
  config.dsn = Rails.application.secrets.sentry_dsn
  config.enable_tracing = true
  config.excluded_exceptions += ['ActionController::RoutingError', 'ActiveRecord::RecordNotFound']
  config.delayed_job.report_after_job_retries = true
end

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Type

Projects

  • Status

    Waiting for: Product Owner

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions