From f8cb0e8f011130ac3989c32037990306b99f426f Mon Sep 17 00:00:00 2001 From: Scott Steeg Date: Tue, 2 Apr 2019 19:50:46 +0900 Subject: [PATCH] Fallback to empty string as Rails 5.1 can't handle nil paths --- CHANGELOG.md | 3 +++ lib/zipkin-tracer/application.rb | 2 +- lib/zipkin-tracer/version.rb | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 768b9b6..aad8899 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.35.1 +* Fix bug with Rails 5.1 when calling recognize_path with a nil path + # 0.35.0 * removes record_on_server_receive option * records status_code and method on all server receive events. diff --git a/lib/zipkin-tracer/application.rb b/lib/zipkin-tracer/application.rb index cf95816..532632e 100644 --- a/lib/zipkin-tracer/application.rb +++ b/lib/zipkin-tracer/application.rb @@ -4,7 +4,7 @@ class Application # Determines if our framework knows whether the request will be routed to a controller def self.routable_request?(env) return true unless defined?(Rails) # If not running on a Rails app, we can't verify if it is invalid - path_info = env[ZipkinTracer::RackHandler::PATH_INFO] + path_info = env[ZipkinTracer::RackHandler::PATH_INFO] || "" http_method = env[ZipkinTracer::RackHandler::REQUEST_METHOD] Rails.application.routes.recognize_path(path_info, method: http_method) true diff --git a/lib/zipkin-tracer/version.rb b/lib/zipkin-tracer/version.rb index 6145509..90665f6 100644 --- a/lib/zipkin-tracer/version.rb +++ b/lib/zipkin-tracer/version.rb @@ -1,3 +1,3 @@ module ZipkinTracer - VERSION = '0.35.0'.freeze + VERSION = '0.35.1'.freeze end