diff --git a/CHANGELOG.md b/CHANGELOG.md index 0df2d3a..b4f6ae9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.29.1 +* Patch abstract route to work with Grape + # 0.29.0 * Add abstract route to span name * Fix not to raise "NoMethodError" for Rails:Module diff --git a/lib/zipkin-tracer/application.rb b/lib/zipkin-tracer/application.rb index cdb7aba..369ed91 100644 --- a/lib/zipkin-tracer/application.rb +++ b/lib/zipkin-tracer/application.rb @@ -13,7 +13,11 @@ def self.routable_request?(path_info, http_method) def self.get_route(env) return nil unless defined?(Rails) - req = Rack::Request.new(env) + stub_env = { + "PATH_INFO" => env[ZipkinTracer::RackHandler::PATH_INFO], + "REQUEST_METHOD" => env[ZipkinTracer::RackHandler::REQUEST_METHOD] + } + req = Rack::Request.new(stub_env) # Returns a string like /some/path/:id Rails.application.routes.router.recognize(req) do |route| return route.path.spec.to_s diff --git a/lib/zipkin-tracer/version.rb b/lib/zipkin-tracer/version.rb index d177495..928fe4b 100644 --- a/lib/zipkin-tracer/version.rb +++ b/lib/zipkin-tracer/version.rb @@ -1,3 +1,3 @@ module ZipkinTracer - VERSION = '0.29.0'.freeze + VERSION = '0.29.1'.freeze end