lib/timber/events/http_response.rb in timber-2.5.0 vs lib/timber/events/http_response.rb in timber-2.5.1
- old
+ new
@@ -11,10 +11,10 @@
class HTTPResponse < Timber::Event
attr_reader :body, :content_length, :headers, :http_context, :request_id, :service_name, :status, :time_ms
def initialize(attributes)
@body = attributes[:body] && Util::HTTPEvent.normalize_body(attributes[:body])
- @content_length = attributes[:content_length]
+ @content_length = Timber::Util::Object.try(attributes[:content_length], :to_i)
@headers = Util::HTTPEvent.normalize_headers(attributes[:headers])
@http_context = attributes[:http_context]
@request_id = attributes[:request_id]
@status = attributes[:status] || raise(ArgumentError.new(":status is required"))
@time_ms = attributes[:time_ms] || raise(ArgumentError.new(":time_ms is required"))
\ No newline at end of file