Skip to content

Commit

Permalink
don't use .delete_prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
jethrodaniel committed Oct 28, 2024
1 parent 9f46b17 commit 3066735
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/datadog/tracing/contrib/grape/endpoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,11 @@ def endpoint_expand_path(endpoint)
route_path = endpoint.options[:path]
namespace = endpoint.routes.first && endpoint.routes.first.namespace || ''

parts = (namespace.split('/') + route_path).reject { |p| p.blank? || p.eql?('/') }
parts.join('/').delete_prefix('/').prepend('/')
path = (namespace.split('/') + route_path)
.reject { |p| p.blank? || p.eql?('/') }
.join('/')
path.prepend('/') if path[0] != '/'
path
end

def service_name
Expand Down

0 comments on commit 3066735

Please sign in to comment.