reputable 0.1.14 → 0.1.15
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/Gemfile.lock +1 -1
- data/lib/reputable/middleware.rb +26 -7
- data/lib/reputable/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: 46a14f8686b7e3ad1aa8a8c2e22f5c14f13a3d6667ad9bb4ca1e088024989f7d
|
|
4
|
+
data.tar.gz: 6b6e95c46a329214b02279c23d02b55067f8a86f74cc6f17159b35dd43d08ef6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 542429b9c9716d69889873b9212b4500669a074c24595f8f933f64568161ca6a562de7b6aa307ede64252b35599d5e768279abee078724d358ab2a2bc14f6f90
|
|
7
|
+
data.tar.gz: e3978a1b8e21332bd1a7e1ef26a719398c478762f74a5959bdc8c85c720de7fe97a03b4c525df7c892273329f8c1d02c1fe38163fcdee21d92479dfc81b735a2
|
data/Gemfile.lock
CHANGED
data/lib/reputable/middleware.rb
CHANGED
|
@@ -145,16 +145,35 @@ module Reputable
|
|
|
145
145
|
|
|
146
146
|
def handle_verification_return(env)
|
|
147
147
|
request = Rack::Request.new(env)
|
|
148
|
-
# Quick check to avoid overhead
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
# Quick check to avoid overhead - support both new (reputable_r) and legacy (reputable_status) formats
|
|
149
|
+
query = request.query_string
|
|
150
|
+
return unless query.include?("reputable_r") || query.include?("reputable_status")
|
|
151
|
+
|
|
152
|
+
params = request.params
|
|
153
|
+
|
|
154
|
+
# Determine status from new format or legacy format
|
|
155
|
+
status = if params["reputable_r"]
|
|
156
|
+
decoded = Reputable.decode_reputable_response(params)
|
|
157
|
+
decoded&.dig("status")
|
|
158
|
+
else
|
|
159
|
+
params["reputable_status"]
|
|
160
|
+
end
|
|
152
161
|
|
|
153
|
-
|
|
162
|
+
return unless status == "pass"
|
|
163
|
+
|
|
164
|
+
if Reputable.verify_redirect_return(params)
|
|
154
165
|
env["reputable.verified"] = true
|
|
155
|
-
|
|
166
|
+
|
|
167
|
+
# Extract ignore_analytics from new format or legacy format
|
|
168
|
+
ignore_analytics = if params["reputable_r"]
|
|
169
|
+
decoded = Reputable.decode_reputable_response(params)
|
|
170
|
+
decoded&.dig("ignore_analytics")
|
|
171
|
+
else
|
|
172
|
+
params["reputable_ignore_analytics"]
|
|
173
|
+
end
|
|
174
|
+
|
|
156
175
|
unless ignore_analytics.nil?
|
|
157
|
-
env["reputable.ignore_analytics"] = ignore_analytics.to_s == "true"
|
|
176
|
+
env["reputable.ignore_analytics"] = ignore_analytics == true || ignore_analytics.to_s == "true"
|
|
158
177
|
end
|
|
159
178
|
|
|
160
179
|
# Store in session if available
|
data/lib/reputable/version.rb
CHANGED