Skip to content

Commit

Permalink
use pointer when loading modules
Browse files Browse the repository at this point in the history
  • Loading branch information
WeidiDeng committed May 8, 2024
1 parent dd203ad commit 8afdf22
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/caddyhttp/reverseproxy/httptransport.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ func (t TLSConfig) MakeTLSClientConfig(ctx caddy.Context) (*tls.Config, error) {
if len(t.RootCAPool) > 0 || len(t.RootCAPEMFiles) > 0 {
return nil, fmt.Errorf("conflicting config for Root CA pool")
}
caRaw, err := ctx.LoadModule(t, "CARaw")
caRaw, err := ctx.LoadModule(&t, "CARaw")
if err != nil {
return nil, fmt.Errorf("failed to load ca module: %v", err)
}
Expand Down
6 changes: 3 additions & 3 deletions modules/caddytls/capools.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ func (t TLSConfig) makeTLSClientConfig(ctx caddy.Context) (*tls.Config, error) {
cfg := new(tls.Config)

if t.CARaw != nil {
caRaw, err := ctx.LoadModule(t, "CARaw")
caRaw, err := ctx.LoadModule(&t, "CARaw")
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -762,7 +762,7 @@ func (lcp *LazyCertPool) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
// set to `true`.
func (lcp LazyCertPool) Validate() error {
if lcp.EagerValidation {
_, err := lcp.ctx.LoadModule(lcp, "CARaw")
_, err := lcp.ctx.LoadModule(&lcp, "CARaw")
return err
}
return nil
Expand All @@ -771,7 +771,7 @@ func (lcp LazyCertPool) Validate() error {
// CertPool loads the guest module and returns the CertPool from there
// TODO: Cache?
func (lcp LazyCertPool) CertPool() *x509.CertPool {
caRaw, err := lcp.ctx.LoadModule(lcp, "CARaw")
caRaw, err := lcp.ctx.LoadModule(&lcp, "CARaw")
if err != nil {
return nil
}
Expand Down

0 comments on commit 8afdf22

Please sign in to comment.