We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ebbf66d + d489306 commit 5bc399dCopy full SHA for 5bc399d
activesupport/lib/active_support/messages/metadata.rb
@@ -37,7 +37,10 @@ def pick_expiry(expires_at, expires_in)
37
end
38
39
def extract_metadata(message)
40
- data = JSON.decode(message) rescue nil
+ begin
41
+ data = JSON.decode(message) if message.start_with?("{")
42
+ rescue ::JSON::JSONError
43
+ end
44
45
if data.is_a?(Hash) && data.key?("_rails")
46
new(decode(data["_rails"]["message"]), data["_rails"]["exp"], data["_rails"]["pur"])
0 commit comments