Skip to content

Commit

Permalink
refactor: use m.Server.TLSConfig instead of private m.tlsConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
blairdrummond committed Aug 12, 2023
1 parent b9169de commit 9586ac9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions mockoidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ type MockOIDC struct {
UserQueue *UserQueue
ErrorQueue *ErrorQueue

tlsConfig *tls.Config
middleware []func(http.Handler) http.Handler
fastForward time.Duration
}
Expand Down Expand Up @@ -122,8 +121,6 @@ func (m *MockOIDC) Start(ln net.Listener, cfg *tls.Config) error {
Handler: handler,
TLSConfig: cfg,
}
// Track this to know if we are https
m.tlsConfig = cfg

go func() {
err := m.Server.Serve(ln)
Expand Down Expand Up @@ -214,7 +211,7 @@ func (m *MockOIDC) Addr() string {
return ""
}
proto := "http"
if m.tlsConfig != nil {
if m.Server.TLSConfig != nil {
proto = "https"
}
return fmt.Sprintf("%s://%s", proto, m.Server.Addr)
Expand Down

0 comments on commit 9586ac9

Please sign in to comment.