File tree Expand file tree Collapse file tree 4 files changed +25
-4
lines changed
antivirus/pkg/server/debug Expand file tree Collapse file tree 4 files changed +25
-4
lines changed Original file line number Diff line number Diff line change 44 "context"
55 "errors"
66 "net/http"
7+ "net/url"
78
89 "github.com/dutchcoders/go-clamd"
910
@@ -28,7 +29,11 @@ func Server(opts ...Option) (*http.Server, error) {
2829 case "clamav" :
2930 return clamd .NewClamd (cfg .Scanner .ClamAV .Socket ).Ping ()
3031 case "icap" :
31- return checks .NewTCPCheck (cfg .Scanner .ICAP .URL )(ctx )
32+ u , err := url .Parse (cfg .Scanner .ICAP .URL )
33+ if err != nil {
34+ return err
35+ }
36+ return checks .NewTCPCheck (u .Host )(ctx )
3237 }
3338 })
3439
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package debug
22
33import (
44 "net/http"
5+ "net/url"
56
67 "github.com/owncloud/ocis/v2/ocis-pkg/checks"
78 "github.com/owncloud/ocis/v2/ocis-pkg/handlers"
@@ -17,9 +18,14 @@ func Server(opts ...Option) (*http.Server, error) {
1718 WithLogger (options .Logger ).
1819 WithCheck ("web reachability" , checks .NewHTTPCheck (options .Config .HTTP .Addr ))
1920
21+ u , err := url .Parse (options .Config .Identity .LDAP .URI )
22+ if err != nil {
23+ return nil , err
24+ }
25+
2026 readyHandlerConfiguration := healthHandlerConfiguration .
2127 WithCheck ("nats reachability" , checks .NewNatsCheck (options .Config .Events .Endpoint )).
22- WithCheck ("ldap reachability" , checks .NewTCPCheck (options . Config . Identity . LDAP . URI ))
28+ WithCheck ("ldap reachability" , checks .NewTCPCheck (u . Host ))
2329
2430 return debug .NewService (
2531 debug .Logger (options .Logger ),
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package debug
22
33import (
44 "net/http"
5+ "net/url"
56
67 "github.com/owncloud/ocis/v2/ocis-pkg/checks"
78 "github.com/owncloud/ocis/v2/ocis-pkg/handlers"
@@ -17,8 +18,12 @@ func Server(opts ...Option) (*http.Server, error) {
1718 WithLogger (options .Logger ).
1819 WithCheck ("http reachability" , checks .NewHTTPCheck (options .Config .HTTP .Addr ))
1920
21+ u , err := url .Parse (options .Config .Ldap .URI )
22+ if err != nil {
23+ return nil , err
24+ }
2025 readyHandlerConfiguration := healthHandlerConfiguration .
21- WithCheck ("ldap reachability" , checks .NewTCPCheck (options . Config . Ldap . URI ))
26+ WithCheck ("ldap reachability" , checks .NewTCPCheck (u . Host ))
2227
2328 return debug .NewService (
2429 debug .Logger (options .Logger ),
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package debug
33import (
44 "context"
55 "net/http"
6+ "net/url"
67
78 "github.com/owncloud/ocis/v2/ocis-pkg/checks"
89 "github.com/owncloud/ocis/v2/ocis-pkg/handlers"
@@ -22,7 +23,11 @@ func Server(opts ...Option) (*http.Server, error) {
2223 WithCheck ("nats reachability" , checks .NewNatsCheck (options .Config .Events .Endpoint )).
2324 WithCheck ("tika-check" , func (ctx context.Context ) error {
2425 if options .Config .Extractor .Type == "tika" {
25- return checks .NewTCPCheck (options .Config .Extractor .Tika .TikaURL )(ctx )
26+ u , err := url .Parse (options .Config .Extractor .Tika .TikaURL )
27+ if err != nil {
28+ return err
29+ }
30+ return checks .NewTCPCheck (u .Host )(ctx )
2631 }
2732 return nil
2833 })
You can’t perform that action at this time.
0 commit comments