Skip to content

Commit 8440a23

Browse files
Fix tests which are broken as of Go 1.7
1 parent 80239c9 commit 8440a23

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

decode_response_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
package saml2
1515

1616
import (
17+
"bytes"
1718
"crypto/tls"
1819
"crypto/x509"
1920
"encoding/pem"
@@ -24,6 +25,7 @@ import (
2425
"github.com/jonboulle/clockwork"
2526
"github.com/russellhaering/goxmldsig"
2627
"github.com/stretchr/testify/require"
28+
rtvalidator "github.com/mattermost/xml-roundtrip-validator"
2729
)
2830

2931
const idpCert = `
@@ -133,11 +135,23 @@ func TestCompressedResponse(t *testing.T) {
133135
}
134136

135137
func TestDecodeColonsInLocalNames(t *testing.T) {
138+
// Handling of double colons was improved in Go 1.7 such that this test no longer fails.
139+
// See: https://go-review.googlesource.com/c/go/+/277892
140+
if rtvalidator.Validate(bytes.NewReader([]byte(`<x::Root/>`))) == nil {
141+
t.Skip()
142+
}
143+
136144
_, _, err := parseResponse([]byte(`<x::Root/>`))
137145
require.Error(t, err)
138146
}
139147

140148
func TestDecodeDoubleColonInjectionAttackResponse(t *testing.T) {
149+
// Handling of double colons was improved in Go 1.7 such that this test no longer fails.
150+
// See: https://go-review.googlesource.com/c/go/+/277892
151+
if rtvalidator.Validate(bytes.NewReader([]byte(`<x::Root/>`))) == nil {
152+
t.Skip()
153+
}
154+
141155
_, _, err := parseResponse([]byte(doubleColonAssertionInjectionAttackResponse))
142156
require.Error(t, err)
143157
}

0 commit comments

Comments
 (0)