Skip to content

Commit 3029930

Browse files
committed
Remove unnecessary escaping in regular expressions.
1 parent b1f1752 commit 3029930

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

test/logoutrequest_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ class RequestTest < Minitest::Test
104104

105105
inflated = decode_saml_request_payload(unauth_url)
106106
assert_match %r[<ds:SignatureValue>([a-zA-Z0-9/+=]+)</ds:SignatureValue>], inflated
107-
assert_match %r[<ds:SignatureMethod Algorithm='http:\/\/www.w3.org\/2000\/09\/xmldsig#rsa-sha1'\/>], inflated
108-
assert_match %r[<ds:DigestMethod Algorithm='http:\/\/www.w3.org\/2000\/09\/xmldsig#rsa-sha1'\/>], inflated
107+
assert_match %r[<ds:SignatureMethod Algorithm='http://www.w3.org/2000/09/xmldsig#rsa-sha1'/>], inflated
108+
assert_match %r[<ds:DigestMethod Algorithm='http://www.w3.org/2000/09/xmldsig#rsa-sha1'/>], inflated
109109
end
110110

111111
it "create a signed logout request with 256 digest and signature methods" do
@@ -125,8 +125,8 @@ class RequestTest < Minitest::Test
125125
request_xml = Base64.decode64(params["SAMLRequest"])
126126

127127
assert_match %r[<ds:SignatureValue>([a-zA-Z0-9/+=]+)</ds:SignatureValue>], request_xml
128-
assert_match %r[<ds:SignatureMethod Algorithm='http:\/\/www.w3.org\/2001\/04\/xmldsig-more#rsa-sha256'\/>], request_xml
129-
assert_match %r[<ds:DigestMethod Algorithm='http:\/\/www.w3.org\/2001\/04\/xmldsig-more#rsa-sha512'\/>], request_xml
128+
assert_match %r[<ds:SignatureMethod Algorithm='http://www.w3.org/2001/04/xmldsig-more#rsa-sha256'/>], request_xml
129+
assert_match %r[<ds:DigestMethod Algorithm='http://www.w3.org/2001/04/xmldsig-more#rsa-sha512'/>], request_xml
130130
end
131131
end
132132

test/request_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ class RequestTest < Minitest::Test
156156
params = OneLogin::RubySaml::Authrequest.new.create_params(settings)
157157
request_xml = Base64.decode64(params["SAMLRequest"])
158158
assert_match %r[<ds:SignatureValue>([a-zA-Z0-9/+=]+)</ds:SignatureValue>], request_xml
159-
assert_match %r[<ds:SignatureMethod Algorithm='http:\/\/www.w3.org\/2000\/09\/xmldsig#rsa-sha1'\/>], request_xml
160-
assert_match %r[<ds:DigestMethod Algorithm='http:\/\/www.w3.org\/2000\/09\/xmldsig#rsa-sha1'\/>], request_xml
159+
assert_match %r[<ds:SignatureMethod Algorithm='http://www.w3.org/2000/09/xmldsig#rsa-sha1'/>], request_xml
160+
assert_match %r[<ds:DigestMethod Algorithm='http://www.w3.org/2000/09/xmldsig#rsa-sha1'/>], request_xml
161161
end
162162

163163
it "create a signed request with 256 digest and signature methods" do
@@ -174,8 +174,8 @@ class RequestTest < Minitest::Test
174174
params = OneLogin::RubySaml::Authrequest.new.create_params(settings)
175175
request_xml = Base64.decode64(params["SAMLRequest"])
176176
assert_match %r[<ds:SignatureValue>([a-zA-Z0-9/+=]+)</ds:SignatureValue>], request_xml
177-
assert_match %r[<ds:SignatureMethod Algorithm='http:\/\/www.w3.org\/2001\/04\/xmldsig-more#rsa-sha256'\/>], request_xml
178-
assert_match %r[<ds:DigestMethod Algorithm='http:\/\/www.w3.org\/2001\/04\/xmldsig-more#rsa-sha512'\/>], request_xml
177+
assert_match %r[<ds:SignatureMethod Algorithm='http://www.w3.org/2001/04/xmldsig-more#rsa-sha256'/>], request_xml
178+
assert_match %r[<ds:DigestMethod Algorithm='http://www.w3.org/2001/04/xmldsig-more#rsa-sha512'/>], request_xml
179179
end
180180
end
181181

0 commit comments

Comments
 (0)