fix ready checks

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
Jörn Friedrich Dreyer committed 2025-07-14 14:12:40 +02:00
1 parent 88cf2d8955
commit cf916b8a2c
4 files changed
+24 -4

No files matched your search

@@ -4,6 +4,7 @@ import (
"context"
"errors"
"net/http"
"net/url"
"github.com/dutchcoders/go-clamd"
@@ -28,7 +29,11 @@ func Server(opts ...Option) (*http.Server, error) {
case "clamav":
return clamd.NewClamd(cfg.Scanner.ClamAV.Socket).Ping()
case "icap":
return checks.NewTCPCheck(cfg.Scanner.ICAP.URL)(ctx)
u, err := url.Parse(cfg.Scanner.ICAP.URL)
if err != nil {
return err
}
return checks.NewTCPCheck(u.Host)(ctx)
}
})