From 785e60a468cccad99c2a25ebaccb174ce7d35bfc Mon Sep 17 00:00:00 2001 From: Tomy Guichard Date: Sun, 24 Aug 2025 18:44:36 +0200 Subject: [PATCH] Add scheme validation to livebox address New client creation now checks if the scheme is present in the livebox address and returns an error if missing, preventing misconfigured URLs. --- internal/client/client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/client/client.go b/internal/client/client.go index 9796126..5d2d3e2 100644 --- a/internal/client/client.go +++ b/internal/client/client.go @@ -85,6 +85,10 @@ func New(client *http.Client, address, username, password string) (*Client, erro return nil, fmt.Errorf("failed to parse livebox address: %w", err) } + if u.Scheme == "" { + return nil, errors.New("scheme is missing in livebox address") + } + u.Path = apiEndpoint return &Client{