@@ -37,8 +37,6 @@ func TestValidate(t *testing.T) {
3737 reg := internal .NewRegistryMemory (t , c , & contextx.Static {C : c .Source (ctx )})
3838 v := NewValidator (reg )
3939
40- testCtx := context .TODO ()
41-
4240 dec := json .NewDecoder (strings .NewReader (validJWKS ))
4341 dec .DisallowUnknownFields ()
4442 var goodJWKS jose.JSONWebKeySet
@@ -129,6 +127,10 @@ func TestValidate(t *testing.T) {
129127 assert .Equal (t , []string {"https://foo/" }, []string (c .PostLogoutRedirectURIs ))
130128 },
131129 },
130+ {
131+ in : & Client {ID : "foo" , TermsOfServiceURI : "javascript:alert('XSS')" },
132+ assertErr : assert .Error ,
133+ },
132134 {
133135 in : & Client {ID : "foo" },
134136 check : func (t * testing.T , c * Client ) {
@@ -163,7 +165,7 @@ func TestValidate(t *testing.T) {
163165 return v
164166 }
165167 }
166- err := tc .v (t ).Validate (testCtx , tc .in )
168+ err := tc .v (t ).Validate (ctx , tc .in )
167169 if tc .assertErr != nil {
168170 tc .assertErr (t , err )
169171 } else {
@@ -179,7 +181,7 @@ type fakeHTTP struct {
179181 c * http.Client
180182}
181183
182- func (f * fakeHTTP ) HTTPClient (ctx context.Context , opts ... httpx.ResilientOptions ) * retryablehttp.Client {
184+ func (f * fakeHTTP ) HTTPClient (_ context.Context , opts ... httpx.ResilientOptions ) * retryablehttp.Client {
183185 c := httpx .NewResilientClient (opts ... )
184186 c .HTTPClient = f .c
185187 return c
@@ -190,7 +192,7 @@ func TestValidateSectorIdentifierURL(t *testing.T) {
190192 var payload string
191193
192194 var h http.HandlerFunc = func (w http.ResponseWriter , r * http.Request ) {
193- w .Write ([]byte (payload ))
195+ _ , _ = w .Write ([]byte (payload ))
194196 }
195197 ts := httptest .NewTLSServer (h )
196198 defer ts .Close ()
0 commit comments