mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 00:49:03 +00:00
Fix fleetctl setup requiring https for localhost (#1270)
This fixes a reversion with fleetctl setup that requires https even for localhost connections. This was previously fixed in #489.
This commit is contained in:
parent
6649d08a05
commit
fee860bc7a
1 changed files with 4 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"github.com/fleetdm/fleet/v4/server/fleet"
|
||||
)
|
||||
|
|
@ -31,8 +32,10 @@ func validateServerURL(urlString string) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if serverURL.Scheme != "https" {
|
||||
|
||||
if serverURL.Scheme != "https" && !strings.Contains(serverURL.Host, "localhost") {
|
||||
return errors.New("url scheme must be https")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue