Skip to content

Commit 8793ef5

Browse files
committed
Fix regex to detect base64 encoded messages
1 parent d5d7db9 commit 8793ef5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/onelogin/ruby-saml/saml_message.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ class SamlMessage
1919
ASSERTION = "urn:oasis:names:tc:SAML:2.0:assertion"
2020
PROTOCOL = "urn:oasis:names:tc:SAML:2.0:protocol"
2121

22-
BASE64_FORMAT = %r(\A[A-Za-z0-9+/]{4}*[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=?\Z)
23-
22+
BASE64_FORMAT = %r(\A([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?\Z)
2423
@@mutex = Mutex.new
2524

2625
# @return [Nokogiri::XML::Schema] Gets the schema object of the SAML 2.0 Protocol schema

0 commit comments

Comments
 (0)