method
extract_from_metadata_envelope
rails latest stable - Class:
ActiveSupport::Messages::Metadata
extract_from_metadata_envelope(envelope, purpose: nil)private
No documentation available.
# File activesupport/lib/active_support/messages/metadata.rb, line 78
def extract_from_metadata_envelope(envelope, purpose: nil)
hash = envelope["_rails"]
if hash["exp"] && Time.now.utc >= parse_expiry(hash["exp"])
throw :invalid_message_content, "expired"
end
if hash["pur"].to_s != purpose.to_s
throw :invalid_message_content, "mismatched purpose"
end
hash
end