File tree 2 files changed +18
-1
lines changed
2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,10 @@ func (f *FakeIDP) WellknownConfig() ProviderJSON {
223
223
return f .provider
224
224
}
225
225
226
+ func (f * FakeIDP ) IssuerURL () * url.URL {
227
+ return f .issuerURL
228
+ }
229
+
226
230
func (f * FakeIDP ) updateIssuerURL (t testing.TB , issuer string ) {
227
231
t .Helper ()
228
232
Original file line number Diff line number Diff line change @@ -47,7 +47,20 @@ func TestMaintainDefault(t *testing.T) {
47
47
// Verify the default client was not broken. This check is added because we
48
48
// extend the http.DefaultTransport. If a `.Clone()` is not done, this can be
49
49
// mis-used. It is cheap to run this quick check.
50
- _ , err = http .DefaultClient .Get ("https://coder.com" )
50
+ req , err := http .NewRequest (http .MethodGet ,
51
+ must (idp .IssuerURL ().Parse ("/.well-known/openid-configuration" )).String (), nil )
51
52
require .NoError (t , err )
53
+
54
+ resp , err := http .DefaultClient .Do (req )
55
+ require .NoError (t , err )
56
+ _ = resp .Body .Close ()
57
+
52
58
require .Equal (t , count (), 2 )
53
59
}
60
+
61
+ func must [V any ](v V , err error ) V {
62
+ if err != nil {
63
+ panic (err )
64
+ }
65
+ return v
66
+ }
You can’t perform that action at this time.
0 commit comments