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.
1 parent 803b27f commit 0552dc1Copy full SHA for 0552dc1
lib/onelogin/ruby-saml/saml_message.rb
@@ -72,12 +72,9 @@ def encode(encoded)
72
Base64.encode64(encoded).gsub(/\n/, "")
73
end
74
75
- ##
76
- # Check if +string+ is base64 encoded
77
- #
78
- # The function is not strict and allows newlines. This is because some
79
- # SAML implementations use newlines in the base64-encoded data even if
80
- # they shouldn't (RFC4648).
+ # Check if the provided string is base64 encoded.
+ # @param message [String] The value to be checked.
+ # @return [Boolean] True if the value is a base64 encoded string.
81
def base64_formatted?(string)
82
string.gsub(/[\r\n]|\\r|\\n/, "").match(BASE64_FORMAT_REGEXP)
83
0 commit comments