gitlab-labkit 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de8b261c2e8cb807efc60666a66cb873ac78515f6683500a5d012d1eb8239253
4
- data.tar.gz: 81db5405e294b647fa851c6673e48f898d0b729785b26173c30ff19860e3d7fb
3
+ metadata.gz: d919fa4752324f93efc91b81d0ad700dac81988219ee5c9644dff15bb895d346
4
+ data.tar.gz: 1fb117e24ae71099aae9c9d9983f0075f6b5a19ca8d344a0e83ceef0a5d45e5b
5
5
  SHA512:
6
- metadata.gz: c38a4dac36cc77fb4cc2df6308ce7e4053be708689b0970f0aebf605da02a347c32c9ffa364bd7db84f6b8e9d978ff07eda1c66d827cac472ca6a5275e4bf654
7
- data.tar.gz: eb0e29293b2185d51f57c16e18087d408e38f2a9f0d5f6ffc12319b87691e2b367e3e9e8f10eddc3301c782a3900a650785be6ba8f3ae5032e648084ed6346ac
6
+ metadata.gz: 8ed25dcd8ce2a723732a65aedd666af035af7c68717bcceec18d82af8a4eb60852e29a034c97fa252c73071a254075de93e7108cf21f319de0e32aae15464b4b
7
+ data.tar.gz: c802b193c9533b871b98e6f84c04d8670de366cc88bd0c66aea2df17a30f20ce85f34509c3107d35c6af004fa34ea78a6441bd751a5e305c900fde3db4e2027b
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = 'gitlab-labkit'
6
- spec.version = '0.0.4'
6
+ spec.version = '0.0.5'
7
7
  spec.authors = ['Andrew Newdigate']
8
8
  spec.email = ['andrew@gitlab.com']
9
9
 
@@ -11,8 +11,8 @@ module Labkit
11
11
  autoload :RackMiddleware, 'labkit/tracing/rack_middleware'
12
12
 
13
13
  module Rails
14
- autoload :ActionViewSubscriber, 'labkit/tracing/rails/action_view_subscriber.rb'
15
- autoload :ActiveRecordSubscriber, 'labkit/tracing/rails/active_record_subscriber.rb'
14
+ autoload :ActionViewSubscriber, 'labkit/tracing/rails/action_view_subscriber'
15
+ autoload :ActiveRecordSubscriber, 'labkit/tracing/rails/active_record_subscriber'
16
16
  autoload :RailsCommon, 'labkit/tracing/rails/rails_common'
17
17
  end
18
18
 
@@ -47,7 +47,11 @@ module Labkit
47
47
  def self.tracing_url(service_name)
48
48
  return unless tracing_url_enabled?
49
49
 
50
- format(tracing_url_template.to_s, { correlation_id: Labkit::Correlation::CorrelationId.current_id.to_s, service: service_name })
50
+ correlation_id = Labkit::Correlation::CorrelationId.current_id.to_s
51
+
52
+ # Avoid using `format` since it can throw TypeErrors
53
+ # which we want to avoid on unsanitised env var input
54
+ tracing_url_template.to_s.gsub('{{ correlation_id }}', correlation_id).gsub('{{ service }}', service_name)
51
55
  end
52
56
  end
53
57
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-labkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Newdigate