Commit 68e9880e authored by Nikita Chernyi's avatar Nikita Chernyi

bugfix websocket check

parent fd548a65
Pipeline #67925343 passed with stage
in 2 minutes and 10 seconds
......@@ -102,10 +102,10 @@ func fetchMonitorURL(client *http.Client, URLMonitor *URLMonitor) (int, error) {
if strings.HasPrefix(URLMonitor.URL, "ws://") || strings.HasPrefix(URLMonitor.URL, "wss://") {
origin, _ := url.Parse(URLMonitor.URL)
ws, err := websocket.Dial(URLMonitor.URL, "", origin.Scheme+"://"+origin.Host)
defer ws.Close()
if err != nil {
return 0, fmt.Errorf("cannot fetch monitor %s: %v", URLMonitor.Name, err)
}
ws.Close()
return 200, nil
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment