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 +4 -4
- data/lib/posthog/client.rb +2 -1
- data/lib/posthog/feature_flags.rb +8 -1
- data/lib/posthog/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3470c88be6d8c14ea9971594125ff23150c36ba3fbb54447f1f2bb54d29093cf
|
|
4
|
+
data.tar.gz: 6d917061e41ff5dc3d6c0c24f1b40d2e9f14a4287bf007c6feb50c63985ef981
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e3cb57892a14e1119c462f819d71cb8d4adffa7944fb56154b74890d195dc3e2162571f9293acb201d471e23c6b154fa5d11464ba105eebaa211adbb22a13bcb
|
|
7
|
+
data.tar.gz: b2926e5cccfe2463faa504bb4639cc5ce35ec53a0dbd5935bf5dec2eb433319a5855bb1d8259c97a83a4007d70de8fd6df73a2d1b75af3f88be1a43b546a29a2
|
data/lib/posthog/client.rb
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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'
|
data/lib/posthog/version.rb
CHANGED