posthog-ruby 3.43.0 → 3.43.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a791a6ebcdb4519473dbb91fd1b37022551c77b35bd14693ca24f80dfb355ab
4
- data.tar.gz: 49f1cb8b7a7b0c3a342ef07116e56fba635fcabdda17e9e44a39a223c2be1214
3
+ metadata.gz: 3470c88be6d8c14ea9971594125ff23150c36ba3fbb54447f1f2bb54d29093cf
4
+ data.tar.gz: 6d917061e41ff5dc3d6c0c24f1b40d2e9f14a4287bf007c6feb50c63985ef981
5
5
  SHA512:
6
- metadata.gz: 1bbe084dd4402912361700172d64969f6160fda2b832ff1e7d4368fa41eeddc07277c8ef0a3542a24411aab4acb4b6e02b70c28a47614588656ab52062d424f9
7
- data.tar.gz: a01be3bb9446f1739000a2178810c8546d6bfc1df60f89a6e729062d9c3c17fd6e008988436c0d12b5857171ef665979de30d0b24a0e97962a4ae126f1bc9f42
6
+ metadata.gz: e3cb57892a14e1119c462f819d71cb8d4adffa7944fb56154b74890d195dc3e2162571f9293acb201d471e23c6b154fa5d11464ba105eebaa211adbb22a13bcb
7
+ data.tar.gz: b2926e5cccfe2463faa504bb4639cc5ce35ec53a0dbd5935bf5dec2eb433319a5855bb1d8259c97a83a4007d70de8fd6df73a2d1b75af3f88be1a43b546a29a2
@@ -147,7 +147,8 @@ module PostHog
147
147
  # The release must already exist in the project, because this option does not create it. Values are
148
148
  # strings, and surrounding whitespace is trimmed. An option that matches neither form is ignored with a
149
149
  # warning. A release that the exception or the request context already sets has precedence over this
150
- # option, and this option has precedence over +POSTHOG_RELEASE_ID+. Other events do not get it.
150
+ # option. A +$release_id+ key set to +nil+ also has precedence, so the exception gets no release from
151
+ # this option. This option has precedence over +POSTHOG_RELEASE_ID+. Other events do not get it.
151
152
  # e.g. `error_tracking: { release: { name: 'my-app', version: ENV.fetch('GIT_SHA') } }`.
152
153
  def initialize(opts = {})
153
154
  symbolize_keys!(opts)
@@ -2491,7 +2491,14 @@ module PostHog
2491
2491
  end
2492
2492
 
2493
2493
  def _request_remote_config_payload(flag_key)
2494
- uri = URI("#{@host}/api/projects/@current/feature_flags/#{flag_key}/remote_config")
2494
+ flag_key_bytes = flag_key.b
2495
+ if ['', '.', '..'].include?(flag_key_bytes)
2496
+ logger.error("[FEATURE FLAGS] Remote config requires a non-empty, non-dot flag key, got #{flag_key.inspect}")
2497
+ return nil
2498
+ end
2499
+
2500
+ segment = flag_key_bytes.gsub(/[^A-Za-z0-9\-._~]/n) { |byte| format('%%%02X', byte.ord) }
2501
+ uri = URI("#{@host}/api/projects/@current/feature_flags/#{segment}/remote_config")
2495
2502
  uri.query = URI.encode_www_form([['token', @project_api_key]])
2496
2503
  req = Net::HTTP::Get.new(uri)
2497
2504
  req['Content-Type'] = 'application/json'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PostHog
4
- VERSION = '3.43.0'
4
+ VERSION = '3.43.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: posthog-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.43.0
4
+ version: 3.43.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - PostHog